1OSMIUM-FILEINFO(1) OSMIUM-FILEINFO(1)
2
3
4
6 osmium-fileinfo - show information about an OSM file
7
9 osmium fileinfo [OPTIONS] OSM-FILE
10
12 Shows various information about OSM files such as the file type, bound‐
13 ing boxes in the header, etc.
14
15 This command will usually only read the file header. Use the --ex‐
16 tended/-e option to show more information.
17
18 Normally this command will output the data in human readable form. If
19 the --json/-j option is used, the output will be in JSON format in‐
20 stead.
21
22 If the --get/-g option is used, only the value of the named variable
23 will be printed.
24
25 The output is split into four sections:
26
27 File This section shows the information available without opening the
28 file itself. It contains the file name, the format deduced from
29 the file name, the compression used and the size of the file in
30 bytes.
31
32 Header This section shows the information available from the header of
33 the file (if available, OPL files have no header). Any avail‐
34 able bounding boxes are shown as well as header options such as
35 the generator and file format version.
36
37 Data This section shows the information available from reading the
38 whole file. It is only shown if the --extended/-e option was
39 used. It shows the actual bounding box calculated from the
40 nodes in the file, the first and last timestamp of all objects
41 in the file, a CRC32 checksum of the data in the file, the num‐
42 ber of changesets, nodes, ways, and relations found in the file,
43 whether the objects in the file were ordered by type (nodes,
44 then ways, then relations) and id, and whether there were multi‐
45 ple versions of the same object in the file (history files and
46 change files can have that). See the osmium-sort(1) man page
47 for details of the expected ordering.
48
49 Metadata
50 This section shows which metadata attributes are used in the
51 file. It contains information which attributes are used by all
52 objects in the file and which are only used by some objects.
53 This section is only shown if the --extended/-e option was used
54 because the whole file has to be read.
55
56 This commands reads its input file only once, ie. it can read from
57 STDIN.
58
60 -c, --crc
61 Calculate the CRC32. This is the default if you use the JSON
62 output format.
63
64 --no-crc
65 Do not calculate the CRC32. This is the default unless you use
66 the JSON output format.
67
68 -e, --extended
69 Read the complete file and show additional information. The de‐
70 fault is to read only the header of the file.
71
72 -g, --get=VARIABLE
73 Get value of VARIABLE. Can not be used together with --json/-j.
74
75 -G, --show-variables
76 Show a list of all variable names.
77
78 -j, --json
79 Output in JSON format. Can not be used together with --get/-g.
80
81 -t, --object-type=TYPE
82 Read only objects of given type (node, way, relation, change‐
83 set). By default all types are read. This option can be given
84 multiple times. This only takes effect if the --extended/-e op‐
85 tion is also used.
86
88 -h, --help
89 Show usage help.
90
91 -v, --verbose
92 Set verbose mode. The program will output information about
93 what it is doing to STDERR.
94
95 --progress
96 Show progress bar. Usually a progress bar is only displayed if
97 STDOUT and STDERR are detected to be TTY. With this option a
98 progress bar is always shown. Note that a progress bar will
99 never be shown when reading from STDIN or a pipe.
100
101 --no-progress
102 Do not show progress bar. Usually a progress bar is displayed
103 if STDOUT and STDERR are detected to be a TTY. With this option
104 the progress bar is suppressed. Note that a progress bar will
105 never be shown when reading from STDIN or a pipe.
106
108 -F, --input-format=FORMAT
109 The format of the input file(s). Can be used to set the input
110 format if it can’t be autodetected from the file name(s). This
111 will set the format for all input files, there is no way to set
112 the format for some input files only. See osmium-file-for‐
113 mats(5) or the libosmium manual for details.
114
116 The following variables are available:
117
118 file.name - STRING
119 file.format - STRING: XML|PBF
120 file.compression - STRING: none|bzip2|gzip
121 file.size - INTEGER (always 0 when reading from STDIN)
122 header.with_history - BOOL (yes|no)
123 header.option.generator - STRING
124 header.option.version - STRING
125 header.option.pbf_dense_nodes - BOOL (yes|no)
126 header.option.osmosis_replication_timestamp - STRING with TIMESTAMP
127 header.option.osmosis_replication_sequence_number - INTEGER
128 header.option.osmosis_replication_base_url - STRING
129 data.bbox - BOX
130 (in JSON as nested ARRAY with coordinates)
131 data.timestamp.first - STRING with TIMESTAMP
132 data.timestamp.last - STRING with TIMESTAMP
133 data.objects_ordered - BOOL (yes|no)
134 data.multiple_versions - STRING (yes|no|unknown)
135 (in JSON as BOOL and missing if "unknown")
136 data.crc32 - STRING with 8 hex digits
137 data.count.nodes - INTEGER
138 data.count.ways - INTEGER
139 data.count.relations - INTEGER
140 data.count.changesets - INTEGER
141 data.minid.nodes - INTEGER
142 data.minid.ways - INTEGER
143 data.minid.relations - INTEGER
144 data.minid.changesets - INTEGER
145 data.maxid.nodes - INTEGER
146 data.maxid.ways - INTEGER
147 data.maxid.relations - INTEGER
148 data.maxid.changesets - INTEGER
149 data.buffers.count - INTEGER
150 data.buffers.size - INTEGER
151 data.buffers.capcity - INTEGER
152 metadata.all_objects.version - BOOL (yes|no)
153 metadata.all_objects.timestamp - BOOL (yes|no)
154 metadata.all_objects.changeset - BOOL (yes|no)
155 metadata.all_objects.uid - BOOL (yes|no)
156 metadata.all_objects.user - BOOL (yes|no)
157 metadata.some_objects.version - BOOL (yes|no)
158 metadata.some_objects.timestamp - BOOL (yes|no)
159 metadata.some_objects.changeset - BOOL (yes|no)
160 metadata.some_objects.uid - BOOL (yes|no)
161 metadata.some_objects.user - BOOL (yes|no)
162
163 All timestamps are in the usual OSM ISO format yy-mm-ddThh::mm::ssZ.
164 Boxes are in the format (xmin, ymin, xmax, ymax).
165
166 There are two variables for each metadata field. The metadata.all_ob‐
167 jects.* variables are true if all objects in the file have the attri‐
168 bute. The metadata.some_objects.* variables are true if at least one
169 object in the file has the attribute. Please note that objects last
170 modified by anonymous users (until 2007) do not have user and uid at‐
171 tributes and can lead to wrong results.
172
174 osmium fileinfo exits with exit code
175
176 0 if everything went alright,
177
178 1 if there was an error processing the data, or
179
180 2 if there was a problem with the command line arguments.
181
183 osmium fileinfo does all its work on the fly and doesn’t keep much data
184 in main memory.
185
187 • osmium(1), osmium-file-formats(5), osmium-sort(1)
188
189 • Osmium website (https://osmcode.org/osmium-tool/)
190
192 Copyright (C) 2013-2021 Jochen Topf <jochen@topf.org>.
193
194 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/li‐
195 censes/gpl.html>. This is free software: you are free to change and
196 redistribute it. There is NO WARRANTY, to the extent permitted by law.
197
199 If you have any questions or want to report a bug, please go to
200 https://osmcode.org/contact.html
201
203 Jochen Topf <jochen@topf.org>.
204
205
206
207 1.13.1 OSMIUM-FILEINFO(1)