OSM file formats
Map-data
The most important formats are:
- PBF Format – highly compressed, optimized binary format similar to the API, recommended for data processing
- OSM XML – XML format provided by the API. Please use PBF if you can.
- OSM JSON – JSON format provided by the API, based on Overpass API JSON format.
- o5m – for high-speed processing, uses PBF coding, has same structure as XML format, limited support by applications
- Overpass JSON – JSON variant of OSM XML, used by Overpass API
- Level0L – more human readable OSM XML without <> and lowered redundancy
Conversion between different OSM map data formats
Software | OSM XML | OSM JSON / | PBF | o5m | Discussion / comments |
---|---|---|---|---|---|
Osmium | yes | no | yes | read only | use the Osmium command line tool or see osmium_convert in examples directory |
osmconvert | yes | no | yes | yes | own PBF implementation (does not use a library) |
Osmosis | yes | no | yes | no | software unmaintained but still in wide use |
osm4j | yes | no | yes | no |
To do: Add matrix which tool converts with format to which target format
Splitting one big file into different geographical regions
- Osmium command line tool (using the extract command), most performant
- Osmosis (unmaintained)
- osmconvert
- osmsplit
- splitter (used as preprocessing step to create maps for Garmin GPS receivers)
Filter for specific tags
- Osmosis (unmaintained)
- osmfilter
- Osmium Tool "tags-filter" command
File formats for diffs
Format | Pros | Cons | Supported by |
---|---|---|---|
OsmChange |
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. |
|
|
o5c |
|
|
|
Augmented Diffs id-sorted version |
|
| |
JOSM_file_format |
|
|
TODO: Insert content from XML#Flavours (pros + cons, etc)
Tools for applying diffs to map data files
- Osmium command line tool (use the "apply-changes" command)
- pyosmium-up-to-date can download diffs and apply them to a planet file or regional extract
- osmconvert
- osmupdate
- Osmosis (unmaintained)
Tools for creating diff files
- Osmium command line tool (use the "derive-changes" command)
- osmconvert
- Osmosis (unmaintained)
Other variants of OSM map data
- JOSM file format – non-indexed xml-format similar to the API
- Spaten - Spaten format by Thomas Skowron (based on PBF and WKB)
- OSM Express on-disk format based on LMDB and S2
- mapsplit compact tiled raw OSM data in pbf format suitable for editors and other applications that need fast, offline access.
Application specific formats which are not intended to carry complete OSM data
- OSMbin (file format) – indexed, mutable binary format
- OSM Mobile Binary Format – read-only binary-format without nodes
- OBF – native format of OsmAnd
See also
This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.