NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello, we got an issue with private instance using official docker image. We have issue with some postal codes. For example the public api returns correct data (the issue also occurs with street name and number) for the city:

https://nominatim.openstreetmap.org/search.php?postalcode=89-501&format=jsonv2

but our instance returns empty reply. However, when refering to county postcode:

https://nominatim.openstreetmap.org/search.php?postalcode=89-500&format=jsonv2

we do get proper reply from our selfhosted instance, including detailed query with street name/number (we get correct geolocation using the general county post-code)

Our instance configuration is as follows (deployed using docker compose):

POSTGRES_SHARED_BUFFERS: "2GB"

POSTGRES_MAINTENANCE_WORK_MEM: "10GB"

POSTGRES_AUTOVACUUM_WORK_MEM: "2GB"

POSTGRES_WORK_MEM: "50MB"

POSTGRES_EFFECTIVE_CACHE_SIZE: "8GB"

PBF_URL: "https://download.geofabrik.de/europe/poland-latest.osm.pbf" REPLICATION_URL: "https://download.geofabrik.de/europe/poland-updates/" IMPORT_STYLE: "address"

Docker image we use is: mediagis/nominatim:4.0.

Checked for update using:

sudo -u nominatim nominatim replication -v --check-for-updates --project-dir /nominatim

and its up-to-date. Any hints on what may be the issue here? Can too low level import style have anything to do with it?

The 89-500 is general county code https://znajdzkodpocztowy.pl/szukaj/mk-89-500/, the 89-501 is strictly city code https://znajdzkodpocztowy.pl/szukaj/mk-89-501/ . The issue extends to other cities as well. If address is specified with general county code everything works, but when local city code is used, reply is empty. The issue does not occur on public api - all local city codes give correct rply. Anything in config we should change?

asked 12 May '22, 08:53

mzaw9's gravatar image

mzaw9
14112
accept rate: 0%

edited 12 May '22, 10:57

1

When was the initial import?

(12 May '22, 09:19) lonvia

around 2 months ago. replication is working once/day the issue is wide - it has county codes, but missing local city-codes; however, it works on public api.

can this: https://github.com/osm-search/Nominatim/blob/2d1a22705f7f2f067f2c839c32caf55941a37b01/settings/import-full.style#L18 difference between address and full import be a culprit?

(12 May '22, 09:22) mzaw9

Quick answer: You need to update the postcode data on your instance with the following command: nominatim refresh --postcode. Make sure that there are no updates running at the same time. The update takes between 20min and an hour, depending on your hardware.

Background: Postcode data is not directly available in OSM. There are only postcodes as part of addresses. To make search for postcodes work, Nominatim takes the postcodes from all the address and computes a centroid point for each of them. This is a rather expensive process, so it is not done as part of the regular updates. You have to occasionally run the process manually using the command above.

Addresses with the postcode '89-501' were first entered in OSM only a couple of weeks ago. That's why your instance does not have them yet. If you have regularly applied updates, the data is there. Recomputing the postcode centroids will make them searchable.

permanent link

answered 18 May '22, 08:34

lonvia's gravatar image

lonvia
6.2k25789
accept rate: 40%

thanks, that helped; we also automated the refresh to once a day (same as update)

(19 May '22, 14:17) mzaw9

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:

×689
×123
×69
×55
×10

question asked: 12 May '22, 08:53

question was seen: 1,545 times

last updated: 19 May '22, 14:17

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum