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 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 |
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. answered 16 Jun '14, 15:37 cartinus 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
|