geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.95k stars 519 forks source link

Google Maps: fails to populate country for "Ireland" #641

Closed norkunas closed 7 years ago

norkunas commented 7 years ago

http://maps.googleapis.com/maps/api/geocode/json?address=Ireland&language=en http://maps.googleapis.com/maps/api/geocode/json?address=Netherlands&language=en

Geocoding netherlands properly returns "country" in address components, while Ireland returns "establishment" instead and updateAddressComponent fails to populate the country name. Is there an easy way to workaround this? Because this violates Geocoder\Model\Country::getName() return type

Nyholm commented 7 years ago

I do not quite understand. But aren't you saying that this is an error on Google?

norkunas commented 7 years ago

I don't know if this is an error on google, but I expect that Ireland like other countries should be properly populated :)

arubacao commented 7 years ago

The geocoder library relies on external services. If external services like googlemaps do not return satisfactory results, it is not the fault of geocoder. That being said, api calls to googlemaps can (and should) be more explicit: https://developers.google.com/maps/documentation/geocoding/intro?hl=en#ComponentFiltering PRs #619 and #620 now support this functionality

Nyholm commented 7 years ago

Thank you @arubacao

I will close this issue.