[postal_code] doesn't work for addresses in the netherlands

Why is this? And can I help to debug/fix it?

Comments

steinmb’s picture

Title: [postal_code] doesn't work for addresses in the netherlands » [postal_code] doesn't work for addresses outside the US?

Did a quick test, but I do not think it is only related to your country. Do you mind testing a few other country's as well?

open social’s picture

I am sorry, I moved on to more custom solutions for mapping and geocoding.
I think the reason for the bug is that google simply does not send it while geocoding.

The main problem is this:

A zipcode in the netherlands can consist of numbers and two letters like: 3924 HG
When using the google geocoding the letters aren't in the return object.

steinmb’s picture

Title: [postal_code] doesn't work for addresses outside the US? » [postal_code] doesn't work for addresses in some countries

That is OK, I'm cleaning up old issues trying getting the module a bit more up2date.

I did a few manual tests against maps.google.com and I think you are right. Google return [postal_code_prefix] if I search for Oudezijds Voorburgwal 197 1012 EX, Amsterdam, Netherlands
http://maps.google.no/maps/api/geocode/json?address=Oudezijds%2BVoorburg...

Result from maps.google.com

Array
(
    [0] => Array
        (
            [address] => Oudezijds Voorburgwal 197, 1012 Binnenstad, Nederland
            [components] => Array
                (
                    [street_number] => 197
                    [route] => Oudezijds Voorburgwal
                    [sublocality] => Binnenstad
                    [locality] => Amsterdam
                    [administrative_area_level_2] => Government of Amsterdam
                    [administrative_area_level_1] => Nord-Holland
                    [country] => Nederland
                    [country_code] => NL
                    [postal_code_prefix] => 1012
                    [street_address] => Oudezijds Voorburgwal 197, 1012 Binnenstad, Nederland
                )

            [location] => Array
                (
                    [lat] => 52.3711643
                    [lng] => 4.8954575
                )

            [bounds] => Array
                (
                    [northeast] => stdClass Object
                        (
                            [lat] => 52.3725132803
                            [lng] => 4.89680648029
                        )

                    [southwest] => stdClass Object
                        (
                            [lat] => 52.3698153197
                            [lng] => 4.89410851971
                        )

                )

        )

)
steinmb’s picture

Status: Active » Closed (works as designed)