1OSMIUM-FILE-FORMATS(5) OSMIUM-FILE-FORMATS(5)
2
3
4
6 osmium-file-formats - OSM file formats known to Osmium
7
9 OSM uses three types of files for its main data:
10
11 Data files
12 These are the most common files containing the OSM data at a
13 specific point in time. This can either be a planet file con‐
14 taining all OSM data or some kind of extract. At most one ver‐
15 sion of every object (node, way, or relation) is contained in
16 this file. Deleted objects are not in this file. The usual
17 suffix used is .osm.
18
19 History files
20 These files contain not only the current version of an object,
21 but their history, too. So for any object (node, way, or rela‐
22 tion) there can be zero or more versions in this file. Deleted
23 objects can also be in this file. The usual suffix used is .osm
24 or .osh. Because sometimes the same suffix is used as for nor‐
25 mal data files (.osm) and because there is no clear indicator in
26 the header, it is not always clear what type of file you have in
27 front of you.
28
29 Change files
30 Sometimes called diff files or replication diffs these files
31 contain the changes between one state of the OSM database and
32 another state. Change files can contains several versions of an
33 object. The usual suffix used is .osc.
34
35 All these files have in common that they contain OSM objects (nodes,
36 ways, and relations). History files and change files can contain sev‐
37 eral versions of the same object and also deleted objects, data files
38 can’t.
39
40 Where possible, Osmium commands can handle all file types. For some
41 commands only some file types make sense.
42
44 The osmium command line tool supports all major OSM file formats plus
45 some more. These are:
46
47 · The classical XML format in the variants .osm (for data files), .osh
48 (for data files with history) and .osc (for change files).
49
50 · The PBF binary format (usually with suffix .osm.pbf or just .pbf).
51
52 · The OPL format (usually with suffix .osm.opl or just .opl).
53
54 · The O5M/O5C format (usually with suffix .o5m or .o5c) (reading only).
55
56 · The “debug” format (usually with suffix .osm.debug) (writing only).
57
58 In addition files in all formats except PBF can be compressed using
59 gzip or bzip2. (Add .gz or .bz2 suffixes, respectively.)
60
62 Which format a file has is usually autodetected from the file name suf‐
63 fix.
64
65 If this doesn’t work, either because you are reading from STDIN or
66 writing to STDOUT, or because you have an unusual file name, you have
67 to set the format manually. You can also set the format manually if
68 you want to specify special format options.
69
70 Most osmium commands support the --input-format/-F and --output-for‐
71 mat/-f options to set the format. They take a comma-separated list of
72 arguments, the first is the format, further arguments set additional
73 options.
74
76 The following options can be added when writing OSM files:
77
78 xml_change_format=true/false
79 Enable/disable XML change format. Same as .osc.
80
81 force_visible_flag=true/false (default: false)
82 Force writing of visible flag, even for normal OSM XML files.
83
84 pbf_dense_nodes=true/false (default: true)
85 Enable/disable DenseNodes format for PBF files.
86
87 pbf_compression=true/false (default: true)
88 Enable/disable compression in PBF files. Disabling this will
89 make writing files a bit faster, but the resulting files are 2
90 to 3 times bigger.
91
92 add_metadata=true/false (default: true)
93 Enable/disable writing of object metadata such as changeset id,
94 username, etc. Disabling this will make files a bit smaller.
95
97 Here are some examples:
98
99 pbf PBF format.
100
101 pbf,add_metadata=false
102 PBF format, don’t write metadata
103
104 osm.bz2
105 XML format, compressed with bzip2.
106
107 osc.gz OSM change file, compressed with gzip.
108
109 osm.gz,xml_change_format=true
110 OSM change file, compressed with gzip.
111
112 osh.opl
113 OSM history file in OPL format.
114
116 · osmium(1)
117
118 · Osmium website (https://osmcode.org/osmium-tool/)
119
120 · OSM File Formats Manual (https://osmcode.org/file-formats-manual/)
121
123 Copyright (C) 2013-2019 Jochen Topf <jochen@topf.org>.
124
125 License GPLv3+: GNU GPL version 3 or later
126 <https://gnu.org/licenses/gpl.html>. This is free software: you are
127 free to change and redistribute it. There is NO WARRANTY, to the
128 extent permitted by law.
129
131 If you have any questions or want to report a bug, please go to
132 https://osmcode.org/contact.html
133
135 Jochen Topf <jochen@topf.org>.
136
137
138
139 1.11.1 OSMIUM-FILE-FORMATS(5)