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


Before importing a huge world osm file with using osm2pgsql, I was recommended to use osmfilter to filter the input file down first. So that an osm file used for import only contains data that I need.

The final goal is to get all admin boundaries as areas, and all places as dots (like cities, villages, suburbs and so on). This data will be used in the following way:

  • admin boundaries are used to render a very simple map of a particular country (infographics)
  • places are used to put cities (as dots) on that map

That's basically all we need from the data.

We would like to automated populating data, so using osmtools sounds okay.

Тow, if the first stage is to filter down the big OSM file, what's the best configuration to only have data described above and nothing else? So that the final database is of small size and can be queried very fastly.

asked 03 Jul '17, 11:15

meglio's gravatar image

accept rate: 0%

I don't know how to do that with osmfilter. But with Osmium it is simple:

osmium tags-filter planet.osm.pbf n/place=city r/type=boundary -o filtered.osm.pbf
permanent link

answered 03 Jul '17, 18:03

Jochen%20Topf's gravatar image

Jochen Topf
accept rate: 31%

edited 03 Jul '17, 18:03

Thanks @Jochen. In some cases, places can be represented as boundaries; in other cases, they can be represented as nodes. Is there any way to get only dots (nodes) and never boundaries for all my filtered places?

(03 Jul '17, 23:11) meglio

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 03 Jul '17, 11:15

question was seen: 4,053 times

last updated: 03 Jul '17, 23:11

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