I have a list of users from across the world in JSON format. Each item in the list has a location information.
- How do I convert these locations to proper longitude and latitude?
- How do I filter these locations to get only locations within 50 miles of my current location (assuming I know how to get current longitude and latitude).
Is there a Service that I can use?
Do I really need to convert these locations to longitude and latitudes? Essentially all I want to do is find locations withing 50 miles of current location and ignore others.
You can use the free geonames.org webservice for that. There is a search method available where you can give a location name and get latitude and longitude for any location. Be aware that there may be multiple locations with the same name available. See the example here: http://api.geonames.org/searchJSON?q=london&maxRows=10&username=demo
For your second question, there are multiple approaches. The basic algorithms are outlined in this question, but probably the easiest way is to use the Google Maps API (see second answer to this question).