1
votes

I am using Google Maps API Geocoder to geocode an address.

Problem: When the server does the geocoding, I often (not always) get results that have the exact same lat/lng, and this is the lat/lng of the city center.

However when I call the exact same URL on my browser, I always get the correct lat/lng returned!

Any idea why its returning the wrong and different results when the same URL is called from server and from my browser?

Query URL

http://maps.googleapis.com/maps/api/geocode/json?address=6954 N Greenview, Chicago, IL&sensor=false&region=us

Results on Server (Using curl)

"lat": 41.8781136
"lng": -87.6297982

Results on Browser

"lat" : 42.0082060,
"lng" : -87.66836499999999
1
See this Region Biasing.The Alpha
Thanks, I believe that I'm biasing the region to us. I've appended &region=us to the end of the query url.Nyxynyx

1 Answers

0
votes

I also believe it's region bias but did you tried comparing name and address of the result? It's happen to me sometimes I get the address and not the name lat lng pairs. I suggest you also to try this url from google http://maps.google.com/maps/geo?q= see my answer: Google Maps API: Geocode returns different co-ordinates then Google maps.