1OSMIUM-APPLY-CHANGES(1) OSMIUM-APPLY-CHANGES(1)
2
3
4
6 osmium-apply-changes - apply OSM change file(s) to OSM data file
7
9 osmium apply-changes [OPTIONS] OSM-DATA-FILE OSM-CHANGE-FILE...
10 osmium apply-changes [OPTIONS] OSM-HISTORY-FILE OSM-CHANGE-FILE...
11
13 Merges the content of all OSM change files and applies those changes to
14 the OSM data or history file.
15
16 Objects in the data or history file must be sorted by type, ID, and
17 version.
18
19 Objects in change files need not be sorted, so it doesn’t matter in
20 what order the change files are given or in what order they contain the
21 data. (If you are using change files of extracts this is not necessar‐
22 ily true and you must specify the change files on the command line in
23 the correct order from oldest to newest. This is because change files
24 from extracts can contain multiple different object versions with the
25 same version and timestamp!)
26
27 Changes can be applied to normal OSM data files or OSM history files
28 with this command. File formats will be autodetected from the file
29 name suffixes, see the --with-history/-H option if that doesn’t work.
30
31 This commands reads its input file(s) only once and writes its output
32 file in one go so it can be streamed, ie. it can read from STDIN and
33 write to STDOUT.
34
36 -H, --with-history
37 Update an OSM history file (instead of a normal OSM data file).
38 Both input and output must be history files. This option is
39 usually not necessary, because history files will be detected
40 from their file name suffixes, but if this detection doesn’t
41 work, you can force this mode with this option. Can not be used
42 together with the --locations-on-ways option.
43
44 --locations-on-ways
45 Input has and output should have node locations on ways. Can be
46 used to update files created by the osmium-add-locations-to-
47 ways. See there for details on the format. Can not be used to‐
48 gether with the --with-history/-H option.
49
50 --redact
51 Redact (patch) history files. Change files can contain any ver‐
52 sion of any object which will replace that version of that ob‐
53 ject from the input. This allows changing the history! This
54 mode is for special use only, for instance to remove copyrighted
55 or private data.
56
57 -r, --remove-deleted
58 Deprecated. Remove deleted objects from the output. This is
59 now the default if your input file is a normal OSM data file
60 (`.osm').
61
62 -s, --simplify
63 Deprecated. Only write the last version of any object to the
64 output. This is now the default if your input file is a normal
65 OSM data file (`.osm').
66
68 -h, --help
69 Show usage help.
70
71 -v, --verbose
72 Set verbose mode. The program will output information about
73 what it is doing to STDERR.
74
75 --progress
76 Show progress bar. Usually a progress bar is only displayed if
77 STDOUT and STDERR are detected to be TTY. With this option a
78 progress bar is always shown. Note that a progress bar will
79 never be shown when reading from STDIN or a pipe.
80
81 --no-progress
82 Do not show progress bar. Usually a progress bar is displayed
83 if STDOUT and STDERR are detected to be a TTY. With this option
84 the progress bar is suppressed. Note that a progress bar will
85 never be shown when reading from STDIN or a pipe.
86
88 -F, --input-format=FORMAT
89 The format of the OSM-DATA-FILE or OSM-HISTORY-FILE. Can be
90 used to set the input format if it can’t be autodetected from
91 the file name. See osmium-file-formats(5) or the libosmium man‐
92 ual for details.
93
94 --change-file-format=FORMAT
95 The format of the OSM-CHANGE-FILE(s). Can be used to set the
96 input format if it can’t be autodetected from the file name(s).
97 This will set the format for all change files, there is no way
98 to set the format for some change files only. See osmium-file-
99 formats(5) or the libosmium manual for details.
100
102 -f, --output-format=FORMAT
103 The format of the output file. Can be used to set the output
104 file format if it can’t be autodetected from the output file
105 name. See osmium-file-formats(5) or the libosmium manual for
106 details.
107
108 --fsync
109 Call fsync after writing the output file to force flushing buf‐
110 fers to disk.
111
112 --generator=NAME
113 The name and version of the program generating the output file.
114 It will be added to the header of the output file. Default is
115 “osmium/” and the version of osmium.
116
117 -o, --output=FILE
118 Name of the output file. Default is `-' (STDOUT).
119
120 -O, --overwrite
121 Allow an existing output file to be overwritten. Normally os‐
122 mium will refuse to write over an existing file.
123
124 --output-header=OPTION=VALUE
125 Add output header option. This command line option can be used
126 multiple times for different OPTIONs. See the osmium-output-
127 headers(5) man page for a list of available header options. For
128 some commands you can use the special format “OPTION!” (ie. an
129 exclamation mark after the OPTION and no value set) to set the
130 value to the same as in the input file.
131
133 osmium apply-changes exits with exit code
134
135 0 if everything went alright,
136
137 1 if there was an error processing the data, or
138
139 2 if there was a problem with the command line arguments.
140
142 osmium apply-changes keeps the contents of all the change files in main
143 memory. This will take roughly 10 times as much memory as the files
144 take on disk in .osm.bz2 format.
145
147 Apply changes in 362.osc.gz to planet file and write result to
148 new.osm.pbf:
149
150 osmium apply-changes --output=new.osm.pbf planet.osm.pbf 362.osc.gz
151
153 • osmium(1), osmium-merge-changes(1), osmium-derive-changes(1), osmium-
154 file-formats(5), osmium-output-headers(5)
155
156 • Osmium website (https://osmcode.org/osmium-tool/)
157
159 Copyright (C) 2013-2022 Jochen Topf <jochen@topf.org>.
160
161 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/li‐
162 censes/gpl.html>. This is free software: you are free to change and
163 redistribute it. There is NO WARRANTY, to the extent permitted by law.
164
166 If you have any questions or want to report a bug, please go to
167 https://osmcode.org/contact.html
168
170 Jochen Topf <jochen@topf.org>.
171
172
173
174 1.14.0 OSMIUM-APPLY-CHANGES(1)