Find the closest reference site for each site in a cws object

find_closest_ref(cws, ref)

Arguments

cws

sf (or inherited) object with citizen weather stations with columns site_id and geometry

ref

sf (or inherited) object with reference weather stations with columns site_id and geometry

Value

sf object with the closest reference site for each cws with additional columns ref_id and dist_to_ref