Getting minimum distance city using langitude- lattitide

20 views
Skip to first unread message

Karimkhan Pathan

unread,
Jan 25, 2014, 11:05:00 PM1/25/14
to google-ajax...@googlegroups.com
When user comes on my page, I get his IP.
Using IP I can get his lang-latt. (Still could not finalized which API is best for this)

Now I have total 6 cities of India. Blore, Mumbai, pune, Hbad, delhi, chennai and their Lang-latt.
Based on his current location I need to find nearest city.

One way is getting distance of all 6 cities from user's current location, one which has min distance, select that city. This distance would be calculated by lang-latt difference using  Haversine_formula. I appreciate some one tell me it's accuracy level.

To get user's current lang-latt I am using ipinfodb API ; http://api.ipinfodb.com/v3/ip-country/?key=<your_api_key>&ip=74.125.45.100

Is there any better way or API to do this more accurately?


Reply all
Reply to author
Forward
0 new messages