1OSMIUM-MERGE(1) OSMIUM-MERGE(1)
2
3
4
6 osmium-merge - merge several sorted OSM files into one
7
9 osmium merge [OPTIONS] OSM-FILE...
10
12 Merges the content of all OSM files given on the command line into one
13 large OSM file. Objects in all files must be sorted by type, ID, and
14 version. The results will also be sorted in the same way. Objects
15 that appear in multiple input files will only be in the output once.
16
17 If there is only a single input file, its contents will be copied to
18 the output.
19
20 If there are different versions of the same object in the input files,
21 all versions will appear in the output. So this command will work fine
22 with history files as input creating a new history file. Do not use
23 this command to merge non-history files with data from different points
24 in time. It will not work correctly.
25
26 If you have objects with the same type, id, and version but different
27 other data, the result of this command is undefined. This situation
28 can never happen in correct OSM files, but sometimes buggy programs can
29 generate data like this. Osmium doesn’t make any promises on what the
30 result of the command is if the input data is not correct.
31
32 This commands reads its input file(s) only once and writes its output
33 file in one go so it can be streamed, ie. it can read from STDIN and
34 write to STDOUT.
35
37 -H, --with-history
38 Do not warn when there are multiple versions of the same object
39 in the input files.
40
42 -h, --help
43 Show usage help.
44
45 -v, --verbose
46 Set verbose mode. The program will output information about
47 what it is doing to STDERR.
48
49 --progress
50 Show progress bar. Usually a progress bar is only displayed if
51 STDOUT and STDERR are detected to be TTY. With this option a
52 progress bar is always shown. Note that a progress bar will
53 never be shown when reading from STDIN or a pipe.
54
55 --no-progress
56 Do not show progress bar. Usually a progress bar is displayed
57 if STDOUT and STDERR are detected to be a TTY. With this option
58 the progress bar is suppressed. Note that a progress bar will
59 never be shown when reading from STDIN or a pipe.
60
62 -F, --input-format=FORMAT
63 The format of the input file(s). Can be used to set the input
64 format if it can’t be autodetected from the file name(s). This
65 will set the format for all input files, there is no way to set
66 the format for some input files only. See osmium-file-for‐
67 mats(5) or the libosmium manual for details.
68
70 -f, --output-format=FORMAT
71 The format of the output file. Can be used to set the output
72 file format if it can’t be autodetected from the output file
73 name. See osmium-file-formats(5) or the libosmium manual for
74 details.
75
76 --fsync
77 Call fsync after writing the output file to force flushing buf‐
78 fers to disk.
79
80 --generator=NAME
81 The name and version of the program generating the output file.
82 It will be added to the header of the output file. Default is
83 “osmium/” and the version of osmium.
84
85 -o, --output=FILE
86 Name of the output file. Default is `-' (STDOUT).
87
88 -O, --overwrite
89 Allow an existing output file to be overwritten. Normally os‐
90 mium will refuse to write over an existing file.
91
92 --output-header=OPTION=VALUE
93 Add output header option. This command line option can be used
94 multiple times for different OPTIONs. See the osmium-output-
95 headers(5) man page for a list of available header options. For
96 some commands you can use the special format “OPTION!” (ie. an
97 exclamation mark after the OPTION and no value set) to set the
98 value to the same as in the input file.
99
101 osmium merge exits with exit code
102
103 0 if everything went alright,
104
105 1 if there was an error processing the data, or
106
107 2 if there was a problem with the command line arguments.
108
110 osmium merge doesn’t keep a lot of data in memory, but if you are merg‐
111 ing many files, the buffers might take a noticeable amount of memory.
112
114 Merge several extracts into one:
115
116 osmium merge washington.pbf oregon.pbf california.pbf -o westcoast.pbf
117
119 • osmium(1), osmium-file-formats(5), osmium-output-headers(5), osmium-
120 merge-changes(1)
121
122 • Osmium website (https://osmcode.org/osmium-tool/)
123
125 Copyright (C) 2013-2022 Jochen Topf <jochen@topf.org>.
126
127 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/li‐
128 censes/gpl.html>. This is free software: you are free to change and
129 redistribute it. There is NO WARRANTY, to the extent permitted by law.
130
132 If you have any questions or want to report a bug, please go to
133 https://osmcode.org/contact.html
134
136 Jochen Topf <jochen@topf.org>.
137
138
139
140 1.14.0 OSMIUM-MERGE(1)