1OSMIUM-APPLY-CHANGES(1)                                OSMIUM-APPLY-CHANGES(1)
2
3
4

NAME

6       osmium-apply-changes - apply OSM change file(s) to OSM data file
7

SYNOPSIS

9       osmium apply-changes [OPTIONS] OSM-DATA-FILE OSM-CHANGE-FILE...
10       osmium apply-changes [OPTIONS] OSM-HISTORY-FILE OSM-CHANGE-FILE...
11

DESCRIPTION

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

OPTIONS

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

COMMON OPTIONS

58       -h, --help
59              Show usage help.
60
61       -v, --verbose
62              Set  verbose  mode.   The  program will output information about
63              what it is doing to STDERR.
64
65       --progress
66              Show progress bar.  Usually a progress bar is only displayed  if
67              STDOUT  and  STDERR  are detected to be TTY.  With this option a
68              progress bar is always shown.  Note that  a  progress  bar  will
69              never be shown when reading from STDIN or a pipe.
70
71       --no-progress
72              Do  not  show progress bar.  Usually a progress bar is displayed
73              if STDOUT and STDERR are detected to be a TTY.  With this option
74              the  progress  bar is suppressed.  Note that a progress bar will
75              never be shown when reading from STDIN or a pipe.
76

INPUT OPTIONS

78       -F, --input-format=FORMAT
79              The format of the OSM-DATA-FILE  or  OSM-HISTORY-FILE.   Can  be
80              used  to  set  the input format if it can’t be autodetected from
81              the file name.  See osmium-file-formats(5) or the libosmium man‐
82              ual for details.
83
84       --change-file-format=FORMAT
85              The  format  of  the OSM-CHANGE-FILE(s).  Can be used to set the
86              input format if it can’t be autodetected from the file  name(s).
87              This  will  set the format for all change files, there is no way
88              to set the format for some change files only.  See  osmium-file-
89              formats(5) or the libosmium manual for details.
90

OUTPUT OPTIONS

92       -f, --output-format=FORMAT
93              The  format  of  the output file.  Can be used to set the output
94              file format if it can’t be autodetected  from  the  output  file
95              name.   See  osmium-file-formats(5)  or the libosmium manual for
96              details.
97
98       --fsync
99              Call fsync after writing the output file to force flushing  buf‐
100              fers to disk.
101
102       --generator=NAME
103              The  name and version of the program generating the output file.
104              It will be added to the header of the output file.   Default  is
105osmium/” and the version of osmium.
106
107       -o, --output=FILE
108              Name of the output file.  Default is `-' (STDOUT).
109
110       -O, --overwrite
111              Allow  an  existing output file to be overwritten.  Normally os‐
112              mium will refuse to write over an existing file.
113
114       --output-header=OPTION=VALUE
115              Add output header option.  This command line option can be  used
116              multiple  times  for  different OPTIONs.  See the osmium-output-
117              headers(5) man page for a list of available header options.  For
118              some  commands you can use the special format “OPTION!” (ie.  an
119              exclamation mark after the OPTION and no value set) to  set  the
120              value to the same as in the input file.
121

DIAGNOSTICS

123       osmium apply-changes exits with exit code
124
125       0      if everything went alright,
126
127       1      if there was an error processing the data, or
128
129       2      if there was a problem with the command line arguments.
130

MEMORY USAGE

132       osmium apply-changes keeps the contents of all the change files in main
133       memory.  This will take roughly 10 times as much memory  as  the  files
134       take on disk in .osm.bz2 format.
135

EXAMPLES

137       Apply  changes  in  362.osc.gz  to  planet  file  and  write  result to
138       new.osm.pbf:
139
140              osmium apply-changes --output=new.osm.pbf planet.osm.pbf 362.osc.gz
141

SEE ALSO

143osmium(1), osmium-merge-changes(1), osmium-derive-changes(1), osmium-
144         file-formats(5), osmium-output-headers(5)
145
146       • Osmium website (https://osmcode.org/osmium-tool/)
147
149       Copyright (C) 2013-2023 Jochen Topf <jochen@topf.org>.
150
151       License  GPLv3+:  GNU  GPL  version  3  or  later  <https://gnu.org/li
152       censes/gpl.html>.  This is free software: you are free  to  change  and
153       redistribute it.  There is NO WARRANTY, to the extent permitted by law.
154

CONTACT

156       If  you  have  any  questions  or  want  to  report a bug, please go to
157       https://osmcode.org/contact.html
158

AUTHORS

160       Jochen Topf <jochen@topf.org>.
161
162
163
164                                    1.16.0             OSMIUM-APPLY-CHANGES(1)
Impressum