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

I'm looking for some guidance on the best way to filter the Europe-latest.osm.pbf file which I've downloaded from Geofabrik. I want to reduce the file to keep all of the 'main' roads; i.e. keeping those tagged:

highway=motorway link 

I want to keep the related data; so keep all nodes and ways for these roads. I'm looking at osmosis and osmfilter and can run some tests, but I thought it worth asking for some guidance here to help focus my efforts. What is the best approach to filtering such a large set of data? I wonder if I need to concern myself with the machine's available memory? (I'm assuming so) How much might I need and how long might it take?

Thanks for any guidance.

asked 26 Feb '15, 16:31

Barryn's gravatar image

accept rate: 0%

I recommend osmfilter over osmosis for doing such a task.

Assuming that you have read documentation about osmfilter and osmconvert in the OSM wiki, I would start do test filtering strategies on a smaller country extract, like Luxembourg or similar.

When you are ok with the filtering parameters and the result file, just start that processing with europe-latest.pbf

Maybe it is godg to have the windows taskmanager or similar program in Linux in the background, to see whether your PC is still working. And check free HD space before.

permanent link

answered 26 Feb '15, 20:01

stephan75's gravatar image

accept rate: 6%


Agreed: osmfilter is well suited to this task and fast.

(27 Feb '15, 11:42) Richard ♦

Osmosis can do the job with the --tag-filter option. You may need a lot of memory to store all the nodes (since you'll have to use the --used-node option). How much memory do you have? The amount of harddisk space you'll need will be less than the europe-latest.osm.pbf file, so as long as you have at least 15GB you should be fine. If I were you, I'd just run it, and if it runs out of memory, it runs out of memory. You'll know in a few hours.

If want to do this in a memory effecient manner, you'd have to write your own programme, e.g. using the Osmium library

permanent link

answered 27 Feb '15, 09:09

rorym's gravatar image

accept rate: 11%

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: 26 Feb '15, 16:31

question was seen: 7,971 times

last updated: 27 Feb '15, 11:42

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