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

NAME

6       osmium-derive-changes - create OSM change files from two OSM data files
7

SYNOPSIS

9       osmium derive-changes [OPTIONS] OSM-FILE1 OSM-FILE2
10

DESCRIPTION

12       Finds  differences between two OSM files and creates a change file with
13       those differences.  The resulting change file is created in a way, that
14       it could be applied on OSM-FILE1 to re-create OSM-FILE2.
15
16       Objects  in  both  input files must be sorted by type, ID, and version.
17       The first input file must be from a point in time before the second in‐
18       put file.
19
20       Only  object  type,  id, and version are compared, so this program will
21       not detect differences in, say, the tags, unless the object has  a  new
22       version,  which  is  the normal way things work in OSM.  If you need to
23       compare all data in OSM files, have a look at the osmium diff program.
24
25       For this command to create a proper change file you  have  to  set  the
26       --output  option or --output-format option in a way that it will gener‐
27       ate an .osc file, typically by using something  like  `-o  out.osc.gz'.
28       You  can create any other OSM file format, but that is usually not what
29       you want.  Osmium derive-changes will warn you in this case.
30
31       Note that for objects  that  are  in  OSM-FILE1  but  not  OSM-FILE2  a
32       “deleted”  entry will be created in the output.  But because we can not
33       know when this deletion actually occurred, in which changeset,  and  by
34       which  user,  it  is unclear what attributes this deleted object should
35       have.  Also, if you are working with extracts, the object might not ac‐
36       tually have been deleted in the OSM database, but just moved out of the
37       extract you are looking at.  So a  real,  new,  “deleted”  version  was
38       never  created.  Usually the “deleted” object will get the same version
39       number and timestamp as the object in OSM-FILE1 had, all other informa‐
40       tion  will  be removed.  But you can change this using the --increment-
41       version, --keep-details, and --update-timestamp options.  Depending  on
42       which  software you are using the change files with, different settings
43       might be necessary.
44
45       This commands reads its input files only once  and  writes  its  output
46       file  in  one go so it can be streamed, ie.  it can read from STDIN and
47       write to STDOUT.
48

OPTIONS

50       --increment-version
51              Increment version number of deleted objects.
52
53       --keep-details
54              Keep details of deleted objects.  Usually only id, version,  and
55              timestamp  are  kept.  If this option is set all attributes, all
56              tags, and all nodes or members for ways and  relations,  respec‐
57              tively, are kept.
58
59       --update-timestamp
60              Update  timestamp  of deleted objects to the current time.  This
61              is the same behaviour as Osmosis.
62

COMMON OPTIONS

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

INPUT OPTIONS

84       -F, --input-format=FORMAT
85              The  format  of the input file(s).  Can be used to set the input
86              format if it can’t be autodetected from the file name(s).   This
87              will  set the format for all input files, there is no way to set
88              the format for some  input  files  only.   See  osmium-file-for‐
89              mats(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 libosmium manual
117              for a list of available header options.  For some  commands  you
118              can  use  the special format “OPTION!” (ie.  an exclamation mark
119              after the OPTION and no value set) to set the value to the  same
120              as in the input file.
121

DIAGNOSTICS

123       osmium derive-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 derive-changes doesn’t keep a lot of data in memory.
133

EXAMPLES

135       Find changes in Nepal extract in January 2016:
136
137              osmium derive-changes nepal-20160101.osm.pbf nepal-20160201.osm.pbf -o nepal-jan.osc.bz2
138

SEE ALSO

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

CONTACT

153       If you have any questions or  want  to  report  a  bug,  please  go  to
154       https://osmcode.org/contact.html
155

AUTHORS

157       Jochen Topf <jochen@topf.org>.
158
159
160
161                                    1.13.1            OSMIUM-DERIVE-CHANGES(1)
Impressum