Hi I want to refine my "search by geolocation" for my platform( http://carrotleads.com) .
I am able to receive the geolocation of a user who lands on my site. Using his IP, I can get the below JSON http://www.freegeoip.net/json/ This is not always consistent as sometimes some fields don't get populated.
My database has customer records that references their area of operation.
How do I calculate the distance of the user to each of my customer and sort the search results in ascending order by distance ( closest customers/entities displayed first.)
For ex: http://farmersmarkets.org.au/markets
displays all markets in my state sorted alphabetically. How can the results be displayed, sorted by distance.
I code on the LAMP stack but happy to look at examples in other languages and adapt it.