Description
Hello Edzer,
I hope you are well. I am having some issues processing distances with my data.
I have two point layers,
- sampling_points <- st_read("..../site_data_all_gck.shp")
- weather_stations <- st_read("..../gcr_weather_stations.shp")
I want to know which weather station is the closest to my sampling points. For this purpose I used st_nearest and it effectively select the row in the weather station that is the closet to my sampling point.
However when I execute the code to get the distance between those two points, for most of the sampling points it works well, but it generates unrealistic distances for some others. Particularly in row 33 of the output file
"sampling_point_nearest_weather_station"
the distance between the "sampling point code" "SF" and the "nearest weather" station "82144" is:
14362.9406 m
but the distance calculated manually using google and QGIS is ~2900m
The layers and the code to replicate the issue are available at
https://github.com/sogm/distance_points_issue
Thanks in advance for helping me figure out what could be happening.
Regards
SGM