Re: [Google Maps API v3] Incorrect reverse geocoding result but correct in "What's here"

253 views
Skip to first unread message

Davide Cremonesi

unread,
Aug 10, 2012, 2:57:11 AM8/10/12
to google-map...@googlegroups.com
I think you found a very peculiar situation in which the shape of the boundary is very different from a rectangle (bounding box) which I believe is used to find matches.
But if you also specify a parameter "bounds" with a box exactly matching your point, you get the right result:


But note that in this way, without a bbox tolerance, you'll hardly find a match on the street level!

Cheers,
Davide Cremonesi

2012/8/9 Abdolhosein V. Ebrahimi <vakil...@gmail.com>
Hi

There are some coordinates in google map on which reverse geocoding reports incorrect country name, but right clicking on very same location and selecting "What's here" will draw a color stroked on boundary of correct country, check example below :

The selected point is in Switzerland, but first result in JSON is Germany:

http://maps.googleapis.com/maps/api/geocode/json?latlng=47.594819,7.679787&sensor=false

Right clicking on very same point highlights Switzerland

Thank you.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/R75SeTFfRiUJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


JKurtock

unread,
Aug 10, 2012, 11:59:41 AM8/10/12
to google-map...@googlegroups.com
I'm not sure that situation is so peculiar.  I believe the GeoCoder tries to return the "nearest" "valid" address. In Abdolhosein's example, the nearest address was across the border in Germany.  Using the bounding box 
(a very thoughtful work-around, thank you) results in an "approximate" location, but one that is closer to the specified lat-lng

I've come across a variant of this when geocoding known-good addresses very near to a County border.  The "official" County 
border is very twisty in order to assure that all of one City is in one County, but the GeoCoder uses a simplified version of 
the border.  As a result, addresses very close to the County border are sometimes GeoCoded into the wrong County.  I expect 
this could happen with Country borders too (but should be less likely).

- Jeff
Davide Cremonesi

To unsubscribe from this group, send email to google-maps-js-api-v3+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages