1OSMIUM-SORT(1) OSMIUM-SORT(1)
2
3
4
6 osmium-sort - sort OSM files
7
9 osmium sort [OPTIONS] OSM-FILE...
10
12 Merges the content of all input files given on the command line and
13 sort the result.
14
15 Objects are sorted by type, ID, and version. IDs are sorted negative
16 IDs first, the positive IDs, both ordered by their absolute values. So
17 the sort order for types and IDs is:
18
19 node -1, node -2, ..., node 1, node 2, ..., way -1, way -2, ..., way 1,
20 way 2, ..., relation -1, relation -2, ..., relation 1, relation 2, ...
21
22 If there are several objects of the same type and with the same ID they
23 are ordered by ascending version. If there are several objects of the
24 same type and with the same ID and version the sort order is unspeci‐
25 fied.
26
27 This command works with normal OSM data files, history files, and
28 change files.
29
30 This commands reads its input file(s) only once and writes its output
31 file in one go so it can be streamed, ie. it can read from STDIN and
32 write to STDOUT. (Unless the multipass strategy is used.)
33
35 -s, --strategy=STRATEGY
36 Sorting strategy. The “simple” strategy reads all input files
37 into memory, does the sorting and writes everything out. The
38 “multipass” strategy reads the input files in three passes, one
39 for nodes, one for ways, and one for relations. After reading
40 all objects of each type, they are sorted and written out. This
41 is a bit slower than the “simple” strategy, but uses less mem‐
42 ory. The “multipass” strategy doesn’t work when reading from
43 STDIN. Default: “simple”.
44
46 -h, --help
47 Show usage help.
48
49 -v, --verbose
50 Set verbose mode. The program will output information about
51 what it is doing to STDERR.
52
53 --progress
54 Show progress bar. Usually a progress bar is only displayed if
55 STDOUT and STDERR are detected to be TTY. With this option a
56 progress bar is always shown. Note that a progress bar will
57 never be shown when reading from STDIN or a pipe.
58
59 --no-progress
60 Do not show progress bar. Usually a progress bar is displayed
61 if STDOUT and STDERR are detected to be a TTY. With this option
62 the progress bar is suppressed. Note that a progress bar will
63 never be shown when reading from STDIN or a pipe.
64
66 -F, --input-format=FORMAT
67 The format of the input file(s). Can be used to set the input
68 format if it can’t be autodetected from the file name(s). This
69 will set the format for all input files, there is no way to set
70 the format for some input files only. See osmium-file-for‐
71 mats(5) or the libosmium manual for details.
72
74 -f, --output-format=FORMAT
75 The format of the output file. Can be used to set the output
76 file format if it can’t be autodetected from the output file
77 name. See osmium-file-formats(5) or the libosmium manual for
78 details.
79
80 --fsync
81 Call fsync after writing the output file to force flushing buf‐
82 fers to disk.
83
84 --generator=NAME
85 The name and version of the program generating the output file.
86 It will be added to the header of the output file. Default is
87 “osmium/” and the version of osmium.
88
89 -o, --output=FILE
90 Name of the output file. Default is `-' (STDOUT).
91
92 -O, --overwrite
93 Allow an existing output file to be overwritten. Normally os‐
94 mium will refuse to write over an existing file.
95
96 --output-header=OPTION=VALUE
97 Add output header option. This command line option can be used
98 multiple times for different OPTIONs. See the libosmium manual
99 for a list of available header options. For some commands you
100 can use the special format “OPTION!” (ie. an exclamation mark
101 after the OPTION and no value set) to set the value to the same
102 as in the input file.
103
105 osmium sort exits with exit code
106
107 0 if everything went alright,
108
109 1 if there was an error processing the data, or
110
111 2 if there was a problem with the command line arguments.
112
114 osmium sort keeps the contents of all the input files in main memory.
115 This will take roughly 10 times as much memory as the files take on
116 disk in .osm.bz2 or osm.pbf format.
117
119 Sort in.osm.bz2 and write out to sorted.osm.pbf:
120
121 osmium sort -o sorted.osm.pbf in.osm.bz2
122
124 • osmium(1), osmium-file-formats(5)
125
126 • Osmium website (https://osmcode.org/osmium-tool/)
127
129 Copyright (C) 2013-2021 Jochen Topf <jochen@topf.org>.
130
131 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/li‐
132 censes/gpl.html>. This is free software: you are free to change and
133 redistribute it. There is NO WARRANTY, to the extent permitted by law.
134
136 If you have any questions or want to report a bug, please go to
137 https://osmcode.org/contact.html
138
140 Jochen Topf <jochen@topf.org>.
141
142
143
144 1.13.1 OSMIUM-SORT(1)