I've installed my own Nominatim instance with the Netherlands database.

In the Netherlands it is possible to lookup a street address by entering a house number and postcode. You can verify this at http://postcode.nl by entering the postcode 9718ES and the house number 24, which will return "Melkweg" as the street name.

In fact, in most cases it is possible to get the street address just from the postcode (without a house number). This is also possible at postcode.nl.

Nominatim also has this data. E.g. when you search for Melkweg 24 the correct postcode 9718ES is returned. However, when you do a lookup like ?q=9718ES 24 or ?street=24&postcode=9718ES nothing is returned.

Is it possible to perform this lookup with Nominatim, or perhaps Nominatim can be altered to include such logic?

asked 16 Jun '14, 15:05

TomM's gravatar image

TomM
41346
accept rate: 0%


No this is currently not possible. Postcode systems the world over are all very different and nobody has yet taken the effort to create the code so Nominatim can understand all those systems. There is some generic support for postcodes, but it is very limited.

On top of that Nominatim doesn't really index the address nodes. It indexes the streets (and selected POI's) and then connects the address nodes to the nearby streets with the same name. For the Netherlands the effect of this is, that the only part of the postcode that is in the index are the four numbers. This is however imprecise (and probably incomplete) as this is based on nodes with a certain tag and not on boundaries.

permanent link

answered 16 Jun '14, 15:37

cartinus's gravatar image

cartinus
6.9k963104
accept rate: 27%

Do you mean that Nominatim never includes the "ES" of the postcode when I search for "9718ES"? If this is the case, how come Nominatim does return "9718ES" when I search for the street address, rather than just "9718"? I would like to patch Nominatim to allow for postcode lookups in the Netherlands (I already forked it), but I have no clue on how its geocoding algorithm currently works. I tried to grasp it in Geocode.php but find it somewhat difficult to understand.

(16 Jun '14, 17:15) TomM

There are nodes with the tag "postal_code". This has in the Netherlands mostly only the 4PP code. Until recently this was basically the only postcode data around here. Now with the BAG data in OSM we have lots of nodes (and ways) with the tag "addr:postcode". However these are only seen as a postcode POI for the indexing when they are included for another reason. E.g. because they are put on an ATM.

If you search with a housenumber (Melkweg 34, Hellevoetsluis) it notices the addr:postcode on the end result and decides that is better (because explicitly tagged) than the guestimate. Notice the greyed out guestimate and the fact the used postcode has no ID in the index.

On top of all this there is the search string parser. How should it know what is a postcode in the following string: "Melkweg 34 3225VE Hellevoetsluis". It's immediately obvious for a Dutchman, but for a computer it could equally be just a long housenumber.

Sorry, I can't help you with the coding.

(16 Jun '14, 18:21) cartinus

It's been two years, the "No this is currently not possible." is still correct?

(06 Oct '16, 13:17) lucas_steffen
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×533
×153
×108
×103
×42

question asked: 16 Jun '14, 15:05

question was seen: 11,455 times

last updated: 06 Oct '16, 13:17

powered by OSQA