New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect parsed name from Google Maps api #1077
Comments
It's because of the order of these two lines: Geocoder/src/Provider/GoogleMaps/GoogleMaps.php Lines 295 to 296 in c2d2c3b
Maybe postal_town should be before locality ?
|
@alanpoulain That won't affect the result unfortunately. |
Thanks for the notice ! @jongotlin For "Pershagen" search, if "Pershagen" is the locality, what should "Södertälje" be ? |
Ideally Pershagen would be a sub locality and Södertälje locality but thats not what the Google response says. Can we have Södertälje in list of admin levels? |
The issue is to keep a logic that works for all countries. |
Aha, understand. Maybe skip Södertälje in this case. The data from Google is not really correct. I think the rule here should be "If locality is set it should not be overridden by postal_town". |
The goal of this library is to create a layer on top of (reverse) geocoding API, not fix/process/mess with the data returned by the API.
I'll make some tests for other countries in the world to see if that applies. |
Yes, understand and agree with that. However, overriding a value like this doesn't seems correct. |
Searching for Pershagen returns the following json
https://maps.googleapis.com/maps/api/geocode/json?address=Pershagen&key=xxx
Using the google maps provider I get the following object. The phrase Pershagen is omitted.
Searching for the similar area Ronna I get a more correct object.
When looping over address components Pershagen is first set but then overridden by Södertälje.
Reversing the array on L235 in GoogleMaps.php returns a more accurate result.
Not at all sure how this will affect other results!
The text was updated successfully, but these errors were encountered: