A couple notes on the code above. For some reason Remember that Mathematica returns GeoNearest[combined[[All, 1]], waypoint]
as a single item list (henceso you will either need to call the use offirst item with [[1]]
in the code)as I did below or use First@GeoNearest[combined[[All, 1]], waypoint]
. Also, if I don't precalculate nearest
and use the following code, Mathematica gets the right answer, but takes several minutes compared to near instant results: