I need to download/create a PBF file containing all osm data for several french urban areas. To select data, I have, for each urban area, the values of the attribute ref:INSEE for every city composing the area.

What could be the best method to do this?

I'm looking for an automatable method, for example by a script with a boundary filter as a parameter.

Geofabrik seems to have automatic tasks to do it for every regions, country and continent.

My environments are a windows local machine and a linux server.


The best place for subsetted datasets is geofabrik IMHO.

The tool of choice, if you want to keep the data in PBF format is Osmosis

It is a java Application and will run on Windows and Linux. I run mine on Windows 2008 R2 and Ubuntu Trusty.

Check Out The Beginners Guide I did not have too much trouble getting to grips with it.

  • Thanks for your advice. I finally have a linux script downloading XML data using OSM XAPI with a bounding box, then converting the XML to PBF using Osmosis. – superrache Jan 12 '15 at 16:46
  • Welcome, For me it is a lot more efficient on Linux than Windows. – Mark Cupitt Jan 13 '15 at 1:04

As an alternative to osmosis you can try to use osmconvert and osmfilter in your scripts. Availeable on both, WIN and Linux.

You can download a bigger country extract from geofabrik.de or other sources, and then do a kind of clipping with bounding boxes or maybe even polygon files.

Maybe there are even boundary relations which describe the exact administrative areas you are looking for.

  • the clipping based on a polygon sounds great, I will try this osmconvert, thanks. – superrache Jan 21 '15 at 8:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.