I am attempting to extract highways (motorways, trunk, and primary roads) for Europe from OpenStreetMap using Osmosis. As I am new to using Osmosis, as an intial test, I downloaded the country osm.pbf file for Denmark from Geofabrik. Using Osmosis and the follow query, I got the roads I needed:

osmosis --rbf denmark-latest.osm.pbf --tf accept-ways highway=motorway,trunk,primary --used-node --wx roads_denmark.osm

I then downloaded the Europe-latest.osm.pbf from geofabrik and ran the same query expecting the same results, but for Europe. However, there are many roads missing, and when you compare the Denmark output it is clearly incorrect. In the image below, green is the output when the Danish data is used, and red when the Europe data is used. The European data is only a fraction of the output from when the Danish data is used.

Road comparison My understanding is that if my query works for one dataset, it should work on another. Therefore:

  1. Is there something fundamental I missing in my understanding? Are the country and European geofabrik data different (apart from coverage)?
  2. Are there potential adjustments I can make to my query to extract the highways?
  • Try asking at help.openstreetmap.org or get into contact with Geofabrik directly. – scai Jul 12 '18 at 20:39
  • I noticed that if you first extract by bounding box for the Denmark from the Europe-latest.osm.pbf (osmosis --rbf europe-latest.osm.pbf --bounding-box top=57.86 left=7.65 bottom=54.17 right=13.09 --wx denmark-area.osm) and then run the query you used for the extracted area then the same roads are included. – Orienteerix Jul 14 '18 at 21:27
  • That's interesting - possibly something to do with the large size of the output file...I'll carry on digging. – meither Jul 19 '18 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.