Closed samaperrin closed 6 years ago
I have added "distanceToLocationName_in_kilometer" column to the location_check the column Return a distance between 2 point in kilometer and 3 decimal to include meter Precision. The sql Return matching localities in proximity ascending order listing the nearest locality first.
New column returning distance: "round(((((ST_distance(st_geomfromtext('POINT(", local_data_temp_filled$decimalLatitude[HEY], local_data_temp_filled$decimalLongitude[HEY], ")', 4326),", "\"localityGeom\") 6378137) pi()) / 180)/1000)::numeric, 3) as \"distanceToLocationName_in_kilometer\",",
listing the nearest localities first "order by \"distanceToLocationName_in_kilometer\";",
Have updated the script so that the changes Marc made in the SQL script are found in the output.
We need 2 extra columns in our matching_locations table (output from the location_check function)
[ ] One that shows which location it matches
[x] One that shows the distance to the matching location