2
votes

I am working with the google goecode API and a few postal codes gets status ZERO_RESULTS even tho' the postal codes exists (when searching on the complete adress I can find it).

Here is the request I send (postal code: W1K6LX in England): https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:W1K6LX%7Ccountry:GB So this gives ZERO_RESULTS

But when I search for the adress: Kalrock 20 North Audley Street I can clearly see "London W1K 6LX" right here: https://www.google.com/maps/place/Kalrock+Capital+Management/@51.5134013,-0.1556717,17z/data=!3m1!4b1!4m5!3m4!1s0x4876052eac174b5f:0xd76bd9d6e03653af!8m2!3d51.513398!4d-0.153483

Am I doing something wrong here?

2
Can you list down other examples of postal code that exists but returns zero_results when geocoded? - tomjosef
BT16 1SB. If you look at royalmail.com you can see that it is valid: royalmail.com/find-a-postcode - Kelsner

2 Answers

5
votes

It looks like there is a data issue here. The postal code W1K6LX seems to be missing in Google database.

First of all I can see that this is a valid postal code according to the Royalmail

enter image description here

As you mentioned the geocoding service returns ZERO_RESULTS, although the place 'Kalrock Capital Management' uses this postal code in the address. I suppose the place was created in Google My Business. If I understand correctly when you create a place in Google My Business you can enter a postal code as a text value and it will be stored, however the postal code feature might be missing from the database.

To check this theory I found the place 'Kalrock Capital Management' in Places API and figured out that the place ID is ChIJX0sXrC4FdkgRr1M24NbZa9c.

I executed geocoding request to get coordinates of this place ID:

https://google-developers.appspot.com/maps/documentation/utils/geocoder/#place_id%3DChIJX0sXrC4FdkgRr1M24NbZa9c

and got coordinate 51.513398,-0.153483.

Now I try to execute reverse geocode to find the nearest postal code for this coordinate:

https://maps.googleapis.com/maps/api/geocode/json?latlng=51.513398%2C-0.153483&result_type=postal_code&key=MY_API_KEY

As you can see the nearest postal code that can be found for this coordinate is W1K 6AG

enter image description here

I can suggest reporting the missing postal code to Google as described in the following page

https://support.google.com/maps/answer/3094045

I hope this helps!

0
votes

I think there are postcodes that are in use by the post office that are not geocodeable. I've just be trying to get a geocode for the London postcode W1S 1BN using OpenStreetMap with no luck, and yet Royal Mail's https://www.royalmail.com/find-a-postcode tells me that it relates to 17 Hanover Square. Using the identical Royal Mail tool to get the postcode for 17 Hanover Square, London, I get W1S 1HU, which is geocodable. So I'm working on the assumption that the Royal Mail creates and uses some special postcodes, probably for certain businesses or business purposes, that don't map directly to a physical location in terms of a geocode.

Using the OP's example, Royal Mail reports three different postcodes for 20 North Audley Street in London, including the two mentioned.