OSMIUM-DIFF(1)

πŸ’– OSMIUM-DIFF πŸ’–

okay bestie, welcome to osmium-diff(1) β€” the little icon that shows you the differences between OSM files 🌸


✨ NAME ✨

osmium-diff β€” display differences between OSM files


πŸŽ€ SYNOPSIS πŸŽ€

osmium diff [OPTIONS] OSM-FILE1 OSM-FILE2

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does is: it finds all the differences between two OSM files and shows them to you. And when I say all the differences, I mean it literally compares every single attribute of every single object β€” so it will even catch, like, a difference in the user name or even just the order of the tags. Which, ngl, is the kind of thing that shouldn't happen in normal OSM data unless there's also a different object version. 🫢

Only differences between objects (nodes, ways, and relations) get found and displayed. Headers are ignored, periodt.

⚠️ Objects in both input files must be sorted in the same order. No cap.

Several output formats are supported, go read the OUTPUT FORMATS section below, it's giving variety πŸ’…

This command is meant for showing the differences between files to actual humans. It can not be used to create an OSM change file (.osc) β€” for that you want osmium-derive-changes, okay? Different girl, different job. πŸ’–


🌈 OUTPUT FORMATS 🌈

These are the formats we support, and you set them with the --output-format/-f options. Default is the compact format.

  • compact β€” a very compact format. For all objects a line is printed with the type of object (n, w, or r), the object ID and then the version number. If objects appear in both files and are identical they are preceded by a space (' ') character, if they are in both files, but different, they are preceded by an asterisk ('*'). Otherwise they get a minus ('-') or plus ('+') character to show that they are only in the first or second file, respectively.
  • opl β€” the usual OPL format with all lines preceded by space (' '), minus ('-'), or plus ('+') characters depending on whether the object is in both, the first, or the second file.
  • debug β€” the usual debug format with all lines preceded by space (' '), minus ('-'), or plus ('+') characters depending on whether the object is in both, the first, or the second file. Color support can be enabled ('debug,color').

None of the output formats print the headers of the input files. πŸ™ˆ


πŸ‘‘ OPTIONS πŸ‘‘

  • -c, --suppress-common β€” do not output objects that are the same in both files. bye bestie, you're not special enough to be printed ✨
  • -f, --output-format=FORMAT β€” see the OUTPUT FORMATS section. that's the vibe picker.
  • --ignore-changeset β€” ignore changeset id on OSM objects when comparing files. When used with the OPL output format the changeset attribute is not written to the output.
  • --ignore-uid β€” ignore user id on OSM objects when comparing files. When used with the OPL output format the uid attribute is not written to the output.
  • --ignore-user β€” ignore user name on OSM objects when comparing files. When used with the OPL output format the user attribute is not written to the output.
  • -o, --output=FILE β€” name of the output file. Default is '-' (STDOUT). πŸ’…
  • -O, --overwrite β€” allow an existing output file to be overwritten. Normally osmium will refuse to write over an existing file. it's protecting you fr fr 🫢
  • -q, --quiet β€” no output. Just report when files differ through the return code. silent but it knows. πŸ’€
  • -s, --summary β€” print count of objects that are only in the left or right files, or the same in both or different in both to STDERR.
  • -t, --object-type=TYPE β€” read only objects of given type (node, way, relation). By default all types are read. This option can be given multiple times. This affects the output as well as the return code of the command.

🌸 COMMON OPTIONS 🌸

  • -h, --help β€” show usage help. always here for you πŸ’œ
  • -v, --verbose β€” set verbose mode. The program will output information about what it is doing to STDERR.
  • --progress β€” show progress bar. Usually a progress bar is only displayed if STDOUT and STDERR are detected to be TTY. With this option a progress bar is always shown. Note that a progress bar will never be shown when reading from STDIN or a pipe.
  • --no-progress β€” do not show progress bar. Usually a progress bar is displayed if STDOUT and STDERR are detected to be a TTY. With this option the progress bar is suppressed. Note that a progress bar will never be shown when reading from STDIN or a pipe.

🧚 INPUT OPTIONS 🧚

  • -F, --input-format=FORMAT β€” the format of the input file(s). Can be used to set the input format if it can't be autodetected from the file name(s). This will set the format for all input files, there is no way to set the format for some input files only. See osmium-file-formats(5) or the libosmium manual for details.

πŸ’… DIAGNOSTICS πŸ’…

osmium diff exits with exit code

  1. 0 β€” if the files are the same,
  2. 1 β€” if the files are different, or
  3. 2 β€” if there was an error

πŸ“ MEMORY USAGE πŸ“

osmium diff doesn't keep a lot of data in memory. low maintenance queen πŸ‘‘


⭐ EXAMPLES ⭐

Show difference between Nepal files from January 2016 and February 2016 in compact format:

osmium diff nepal-20160101.osm.pbf nepal-20160201.osm.pbf

Show in color debug format only those objects that are different:

osmium diff nepal-20160101.osm.pbf nepal-20160201.osm.pbf -f debug,color -c

πŸ”₯ SEE ALSO πŸ”₯


Copyright (C) 2013-2026 Jochen Topf <jochen@topf.org>.

License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


πŸŽ€ CONTACT πŸŽ€

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


πŸ‘‘ AUTHORS πŸ‘‘

Jochen Topf <jochen@topf.org>.


k that's the whole page bestie, and just so you know β€” this is version 1.19.1 of osmium-diff(1), so if you're out here quoting it in the group chat, that's the edition you're quoting πŸ’–βœ¨πŸ¦‹ slay, go diff some files, ily 🫢

πŸ“¦ where this page comes from