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

I am currently trying to extract road networks from OpenStreetMap dumps downloaded on Geofabrik. I am using the following osmosis (version 0.45) command to extract roads:

osmosis \
--rbf input.osm.pbf \
--tf reject-relations \
--tf accept-ways highway=motorway,motorway_link,trunk,trunk_link,primary,primary_link,secondary,secondary_link,tertiary,tertiary_link,unclassified,residential \
--tf reject-ways highway=construction \
--lp --wb output_roads.osm.pbf

This should return a file containing all car roads except service roads.

However, some (and sometimes a lot of) roads are missing. I have tried this command on 3 input files:

  • "Midi-Pyrénées" French region: the road network seems almost complete. The attribute table contains 72010 elements.
  • all of France: a lot of roads are missing. The attribute table contains only 65803 elements (less than a single region). All types of highways are impacted: primary to residential. There is no any obvious pattern for the missing roads.
  • all of Europe: almost all roads are missing. The attribute table contains 62092 elements (less than all of France...).

I guess there is some limitation I am not aware of, either on the osmosis command or on the output file. What am I doing wrong here?

This may be unrelated but I have tried using the --used-node option in order to reduce the size of the output files, but this always generates an error (org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to create object stream writing to temporary file null.). I have no idea why.

asked 21 Aug '18, 13:23

ArMoraer's gravatar image

accept rate: 0%

Hello, Im back to this post because I have exactly the same issue with osmosis...

I looked at this post :

So its seems that there is a limitation to 65356 elements.

Did you manage to download all the roads you wanted ? and if so, how ?

permanent link

answered 19 Nov '19, 15:18

Ludixx's gravatar image

accept rate: 0%

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: 21 Aug '18, 13:23

question was seen: 1,824 times

last updated: 19 Nov '19, 15:18

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