I want to implement an auto-complete search feature in my website, but it should only return municipalities (admin_level="8"). Is there a way to filter for this using the Nominatim API? Or should I use osmosis and cross-check the results?

E.g, 'Utrecht' returns the province, the city, etc, but I only want the municipality. http://nominatim.openstreetmap.org/search?q=utrecht&format=json&countrycodes=nl

If I have to use osmosis, how would I go about it?

asked 03 Feb '13, 11:06

ocky7's gravatar image

ocky7
31113
accept rate: 0%

edited 03 Feb '13, 16:28

Also check out this question.

(03 Feb '13, 18:24) ocky7

I downloaded my country extract from Geofabrik. Then I ran the following osmosis command on the downloaded osm.pbf file:

$ osmosis --read-pbf file=netherlands.osm.pbf --bounding-box left=4 right=5 top=54 bottom=50 --way-key-value value keyValueList=admin_level.8 --tag-filter reject-nodes --tag-filter reject-relations --write-xml municipalities_nl.osm

Which generates an OSM XML file with all the municipality ways. Although I'd like the related polygons as well.

permanent link

answered 03 Feb '13, 18:14

ocky7's gravatar image

ocky7
31113
accept rate: 0%

edited 03 Feb '13, 20:17

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:

×549
×43
×10

question asked: 03 Feb '13, 11:06

question was seen: 2,403 times

last updated: 03 Feb '13, 20:17

powered by OSQA