How is it possible to filter the results of the Google Geocode API and the use of the components parameter for two (or more) countries, without issuing another request.
Example:
http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&components=country:DE,AT&address=wien
http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&components=country:AT,DE&address=wien
http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&components=country:AT|country:DE&address=wien
Is there something in the documentation that I overread that makes it possible, or can't I make it at all?
I tried a workaround with setting the merged bounds of Germany and Austria, but that just weighs the results and not filters them, so I got a result which I didn't want with http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&components=bounds:55.058,17.161|46.372,5.866&address=new%20york
. In this case I want a ZERO_RESULTS status.
This is not currently possible. Please vote up issue #4233 if you want to see this happen.
For time being I can suggest three possible workarounds, none of them perfect:
short_name
of the address_components
element with a types
of country
is not in your list of countries.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With