geocode - 3 different urls 3 different ways for geocoding.What is the correct way of doing it? -
all want geocode given address.im doing in java. earlier used url like
"http://maps.google.com/maps/geo?q=" +urlencoder.encode(addrtofind, encoding) + "&output=csv&key=" + mykey
it returned me comma separated result (status_code,lat,lng,precision) alien reasons url started giving me status code 610(invalid api key) regenerated browser key google in vain.
then got way geocode new url trucated 'geo' word in previous url
"http://maps.google.com/maps?q="+urlencoder.encode(postcode, "utf-8");
i extracted latitude , longitude end result of url noticed url gives me whole html page response while want lat lng , precision.
then found whole new url "//maps.googleapis.com/maps/api/geocode/json?sensor=false&address="+address_to_geocode; gives me json response extracted required information.this url doesnt ask api key too. correct way of doing geocod above 3 or there other optimal way ?
for first url, see this, deprecated v2 geocoding api, lifetime has been extended, not recommended new development.
the second url google map, , not documented use geocoder.
the current v3 geocoding api 1 should using.
Comments
Post a Comment