This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Cannot search on address or postcode after applying osmfilter on a map.

0

Hi all,

I am trying to downsize / shrink the map of The Netherlands by leaving only information about a single city (Laren).

I have done the following:

osmconvert netherlands-latest.osm.pbf -o=netherlands-latest.o5m
osmfilter netherlands-latest.o5m --keep="addr:city=Laren" -o=nl-Laren.o5m

The new map of Laren is imported with the nominatim setup.php script:

./src/utils/setup.php --osm-file /app/src/nl-Laren.o5m --all

The above one is a part of a Dockerfile that I'm using: nominatim-docker. The only thing I have changed in the Dockerfile is putting the new small map of Laren.

However, when I use the web interface or the REST api trying to search by address or postcode I get no results. It looks like not all of the tags or object relations have been preserved after I shrinked the map with osmfilter.

Am I missing something when applying the osmfilter? I would like to leave only nodes related to this city.

Thanks in advance, Peter

asked 08 Sep '17, 09:11

pesho318i's gravatar image

pesho318i
27335
accept rate: 0%

edited 08 Sep '17, 09:15


One Answer:

4

You need to import essentially all (well not quite) data for the area in question to allow nominatim to build its object hierarchy, in particular not just the objects with addresses but the streets in the area too.

With other words instead of using osmfilter you should create an extract of the city in question with a suitable tool (you will need the a bounding box or a boundary polygon for the area in question), for example with http://osmcode.org/osmium-tool/ or http://wiki.openstreetmap.org/wiki/Osmosis

answered 08 Sep '17, 10:15

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 08 Sep '17, 11:36

Thank you, @SimonPoole!

Apparently I was using the wrong tool. Osmium-tool did the job! I used a bounding box instead of polygon, that was enough for me.

Have a great day!

(08 Sep '17, 14:57) pesho318i