[Geocoding] Query with postcode response failure - yet postcode in response.

Sarah Hoffmann lonvia at denofr.de
Sun Aug 24 17:00:25 UTC 2014


Hi,

(sending to mailing list this time)

On Sun, Aug 24, 2014 at 06:04:14PM +0200, ekes wrote:
> Can anyone enlighten me on what the difference going on here is? Is the
> postcode somehow available in the hierarchy, but at the same time
> sometimes not? Or am I overlooking something really obvious?

Postcodes are a bit of a touchy subject. Here is what is going on:

Originally postcodes have been implemented by creating virtual places
for each postcode that exists. These places are a simple node that is
the centroid of all instances of a postcode that can be found in the
DB. Problem is that this is very expensive to compute and therefore
not updated as usual. So, if you search for postcodes, you'll only
find the ones that have been in OSM during the last import of Nominatim
which was around Septemper 2013, I believe.

To improve the situation slightly, there has been a slight change
to the code that computes the address of an object. There postcode
from the object, its street, city etc. are mixed into the response,
so that for displaying objects you actually get postcodes as they
are currently available in ithe OSM data.

To take your example:

> The following query strings return:
>
> ?q=Pretoriusstraat 43-H, Amsterdam&format=json
> ...
> display_name: "43-H, Pretoriusstraat, Oost-Watergraafsmeer, Amsterdam,
> Stadsdeel Oost, Amsterdam, Stadsregio Amsterdam, North Holland, Kingdom
> of the Netherlands, 1092EZ, The Netherlands",

Here the house itself (http://www.openstreetmap.org/node/2826199672)
has an addr:postcode tag which is used when creating the display name.

> But, despite that query returning 1092EZ on Pretoriusstraat
>
> /?q=Pretoriusstraat, Amsterdam, 1092EZ&format=json
> []

This query, however, would need the new postcode to be in the
search index and this search index still fully depends on the
postcode centroids I metioned above. So you cannot really
search for this postcode because it is newer than the centroid
creation.

> Picking one that came up
>
> ?q=Pretoriusstraat, Amsterdam, 1092EX&format=json
> ...
> "display_name": "Amsterdam, Stadsdeel Oost, Amsterdam, Stadsregio
> Amsterdam, North Holland, Kingdom of the Netherlands, 1092EX, The
> Netherlands",

That one, on the other hand, already was in the DB in 2013. You
can check, which postcodes work for a particular street by looking
at the details, e.g. http://nominatim.openstreetmap.org/details.php?place_id=22743808
All postcodes listed in the address section (even the gray ones)
will work. Others won't.

Sarah



More information about the Geocoding mailing list