From OpenStreetMap Wiki
Jump to: navigation, search

OSMT - OSM Split and Merge Tool splits and merges chunks of OpenStreetMap data.

OSMT reads an OSM XML file and splits it into tiles of configurable size expressed in degrees. It also merges tiles previously created by OSMT, producing a single OSM file.

The program is alpha and needs your testing! Use the talk page to report bugs, comments, and questions. You may also contact the author directly.

Get it

The project is hosted on github (includes runnable jar file).


Usage: osmt --split [OPTIONS] SOURCE
or:    osmt --merge --of=DEST [OPTIONS] SOURCE
Split SOURCE file, or merge SOURCE files to DEST file

Options (only in splitting mode):
--output-dir=DIR      write tiles to DIR (defaults to working directory)
--index-file=FILE     write index file (~6 GB) to FILE (defaults to "node2tn" in working directory)
--tile-size=SIZE      create tiles of SIZE degrees in width and height (defaults to 1)
--slim                save temporary nodes on disk, not in RAM


java -jar osmt.jar --split --output-dir=planet-segments --tile-size=0.5 planet.osm
java -jar osmt.jar --merge --of=planet-merged.osm planet-segments/*


Use the Java -Xmx parameter if you get OutOfMemoryError. Increase the limit for open files in your operating system if you get the "Too many open files" error.

Splitting algorithm

OSMT's splitting algorithm is neither a "keep complete ways" nor a "crop ways at bounding boxes" algorithm. It reduces the overhead in each tile to a minimum, while still offering a merge functionality, i.e. ways are split, but in such a way that they can be correctly reproduced by the merge algorithm, at least if no tiles are missing. Singular tiles, as well as the merging results, are suited for all purposes except uploading to the OSM database.

For further reading see the accompanying report.

To Do

  • relation support
  • bz2 support
  • pbf support
  • more tiling schemes
  • BitTorrent functionality
  • database interoperability
  • OsmChange support


Thanks go to the authors of cutTheOsmPlanet.