Page 1 of 1
How do I fetch state & country from latitude & longitude ?
Posted: Fri May 11, 2012 8:06 am
by i-Phonedeveloper
How can we fetch city,state and country from latitude and longitude ?
Re: How do I fetch state & country from latitude & longitude
Posted: Fri May 11, 2012 8:20 am
by SparkOut
define tLat and tLng with your coordinates, then
Code: Select all
get url ("http://maps.googleapis.com/maps/geo?ll=" & tLat & comma & tLng)
put it
parse the results returned, there's lots of information you can gain. "AdministrativeAreaName" is county level in UK, but returns the state in USA. A US county is returned in various forms under "SubAdministrativeArea" > "Locality" > "LocalityName", or just under "SubAdministrativeAreaName" etc etc in one form or another under a set of point ids returned in the results. Check through and see what you think is best to extract.