1

I have a gigantic OSM geodata file of a city, and I want to split it into smaller files according to each group of tags.

I googled it up and i found that there is a jar file caller splitter.jar . i downloaded it and made a test with a small osm geodata, but what i got is a .pbf file which is not readable.

is there any recommended software to split the osm data or i have to do it programmatically?

2 Answers 2

3

The "swiss-knife" for OpenStreetMap data is osmosis. It's a command-line Java application for linux and windows. Learn-OSM provides a great introduction for new users. With osmosis you can split OSM files by a bbox, a polygon or by specific tags. Check out the latest detailed usage wiki page for more information.

3

You want to use Osmosis.

Example with pbf file (much much smaller - it's binary rather than text!):

osmosis --read-pbf city.pbf\
        --tf accept-ways cycleway=track,lane\
        --used-node --write-xml citycycling.osm

or with an osm XML file:

osmosis --read-xml city.osm\
        --tf accept-ways highway=*\
        --used-node --write-xml highways.osm
2
  • 3 mins to slow ... :) Commented Dec 1, 2015 at 15:23
  • You provide some better resources though :)
    – Cyrille
    Commented Dec 1, 2015 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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