Google Maps API Geocode Postal Code and set Country code?

I'm using this API call to Google Maps to get the latitude and longitude of a postal code

http://maps.googleapis.com/maps/api/geocode/json?address=2340&sensor=false

The postal code is in Australia. This API call returns locations all around the world with partial matching postal codes in the address.

Is there a parameter I can use to set the country to Australia?

Thanks

Answers


The correct way to do this is not via region biasing but rather using component filtering:

http://maps.google.com/maps/api/geocode/json
    ?components=country:AU|postal_code:2340
    &sensor=false

Some demonstrations:

Please note that if you use the components parameter, you don't need to specify the address parameter.


The documentation says that Region Biasing is based on CcTLDs, which would make Australia au (haven't tried it myself).

Although it also states this:

Note that biasing only prefers results for a specific domain; if more relevant results exist outside of this domain, they may be included.


Need Your Help

Pre increment vs Post increment in array

c post-increment pre-increment

I am learning programming and I have started from C language. I was reading Let us C book. And I was going through this program in that book.

How do you normalize a file path in Bash?

linux bash unix shell

I want to transform /foo/bar/.. to /foo