OSMIUM-CHECK-REFS(1)

πŸ’– OSMIUM-CHECK-REFS πŸ’–

okay bestie, welcome to the osmium-check-refs manual page (that's the OSMIUM-CHECK-REFS(1) one, from the osmium crew) β€” and yes it is exactly as iconic as it sounds πŸ’…


✨ NAME ✨

osmium-check-refs β€” check referential integrity of OSM file 🫢


🌸 SYNOPSIS 🌸

osmium check-refs [OPTIONS] OSM-DATA-FILE

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: in OSM files, ways refer to nodes, and relations refer to nodes, ways, or other relations. This command checks whether all objects referenced in the input file are also present in the input file. like, is everybody who got @'d actually in the group chat?? that's the vibe check πŸ”₯

Referential integrity is often broken in extracts. This can lead to problems with some uses of the OSM data. Use this command to make sure your data is good. (ngl, extracts be messy like that 😭)

If the option --check-relations/-r is not given, this command will only check if all nodes referenced in ways are in the file. With the option, relations will also be checked. so -r is the "and also check my mutuals" setting πŸ’œ

This command expects the input file to be ordered in the usual way: first nodes in order of ID, then ways in order of ID, then relations in order of ID. Negative IDs are allowed, they must be ordered before the positive IDs. See the osmium-sort(1) man page for details of the ordering. so like, sorted, bestie. in order. no chaos πŸ™ˆ

This command will only work for OSM data files, not OSM history files or change files. periodt. don't even try it.

This command reads its input file only once, ie. it can read from STDIN. one pass, one look, no re-reading, main character energy only πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -i, --show-ids β€” Print all missing IDs to STDOUT. If you don't specify this option, only a summary is shown. so like, -i is the "name names" option πŸŽ€
  • -r, --check-relations β€” Also check referential integrity of relations. Without this option, only nodes in ways are checked.

✨ COMMON OPTIONS ✨

  • -h, --help β€” Show usage help.
  • -v, --verbose β€” Set verbose mode. The program will output information about what it is doing to STDERR. it's giving "narrating my own life" ✨
  • --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. one format to rule them all, fr fr πŸ’€

🧠 MEMORY USAGE 🧠

osmium check-refs will do the check in one pass through the input data. It needs enough main memory to store all temporary data.

Largest memory need will be about 1 bit for each node ID, that's roughly 860 MB these days (February 2020). With the --check-relations/-r option memory use will be a bit bigger. so like, clear some space on your desk bestie πŸ“


πŸ’€ DIAGNOSTICS πŸ’€

osmium check-refs exits with exit code

  1. 0 β€” if all references are satisfied βœ…
  2. 1 β€” if there was an error processing the data or some references were not satisfied 😭
  3. 2 β€” if there was a problem with the command line arguments πŸ™ˆ

πŸ‘‘ 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. (yes, all caps NO WARRANTY, they meant it πŸ’…)


🫢 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>.


okay that's the whole page, you ate it, no cap πŸ’– this was version 1.19.1 of OSMIUM-CHECK-REFS(1) β€” go check those refs bestie, and remember: everybody referenced deserves to actually exist πŸŒŸπŸŽ€

πŸ“¦ where this page comes from