I have a data set with latitude and longitude coordinates (two separate decimal columns). I need to perform a search on them and order them by proximity, based on a supplied lat/lon coordinate.
I am not opposed to converting the columns to a varchar to perform a match/against search, but I know that the match/against is optimized for words.
What would be the best way to sort coordinates by distance? I can do this via PHP if necessary, though I would prefer to do it at the object layer to reduce server load and load times.
I am currently in the process of testing the match/against approach.
Sum up:
Given -90.23, 13.18
return the closest matching latitude/longitude coordinate pairs in order of proximity.
Sample result:
[1] -90.24, 13.17
[2] -90.18, 12.99
[3] -91.78, 16.98
[4] -90.27, 24.78