Reputation: 9524
Google maps API V3 offers two ways to convert an address to a LatLng: google.maps.Geocoder class and Google Geocoding API. While I found that the two methods return different results when I tried to get the LatLng of the same address. And google.maps.Geocoder is more accurate as I have found. Why is that?
I need to make an application to get the LatLng of a list of addresses so the google.maps.Geocoder cannot help on this but the Google Geocoding API is not so accurate. Any ideas?
For example:
On the picture below, the red icon is the result of google.maps.Geocoder and the blue one is the result of Google Geocoding API. They are both from the address: "1 Xinjiekou North Street, Beijing, China"
Thank you!
Upvotes: 0
Views: 922
Reputation: 161334
They both return the same coordinates for me:
Xinjiekou 1st Alley, Xicheng, Beijing, China, 100035 (39.9416447, 116.37176850000003)
"location" : {
"lat" : 39.9416447,
"lng" : 116.3717685
},
Upvotes: 0
Reputation: 117334
It seems that the lat
and lng
of geometry.location
will be rounded to a precision of 7 by the Geocoding-API.
Upvotes: 0