OSM file formats

From OpenStreetMap Wiki
(Redirected from Change file formats)
Jump to navigation Jump to search


The most important formats are:

  • OSM XML – xml-format provided by the API
  • PBF Format – highly compressed, optimized binary format similar to the API
  • o5m – for high-speed processing, uses PBF coding, has same structure as XML format
  • Overpass JSON – JSON variant of OSM XML
  • Level0L - more human readable OSM XML without <> and lowered redundancy

Conversion between different osm map data formats

Software OSM XML PBF o5m Discussion / comments
Osmosis yes yes no
osmconvert yes yes yes own PBF implementation (doesn't use PBF library)
Osmium yes yes read only use the Osmium command line tool or see osmium_convert in examples folder
osm4j yes yes no

ToDO: Add matrix which tool converts with format to which target format...

Splitting one big file into different geographical regions

Filter for specific tags

File formats for diffs

Format Pros Cons Supported by
  • Streamable

When sorted properly this file is a continuous stream of changes that can be played in order. In osmosis the option --sort-change will put the change into streamable order.

  • Doesn't indicate source of data
  • streamable
  • can be processed very fast (uses PBF like encoding, similar to .o5m format)
  • small file sizes even when not compressed
  • not human-readable
  • cannot be modified directly with texteditors
Augmented Diffs id-sorted version
  • streamable
  • real diff as before and after values are included
  • Supports placeholders
  • Indicates the source of the data
  • Not streamable

TODO: Insert content from XML#Flavours (pros + cons, etc)

Tools for applying diffs to map data files

Tools for creating diff files

Other variants of OSM map data

Application specific formats which are not intended to carry complete OSM data

See also