OSMIUM-TIME-FILTER(1)

πŸ’– osmium-time-filter πŸ’–

okay bestie, gather round, because osmium-time-filter is literally the time machine of the osmium universe and i need you to be seated for this. it's the manual page for the osmium-time-filter command, and it does one thing gorgeously: it filters OSM data by time from a history file. slay. πŸ•°οΈβœ¨


✨ NAME ✨

osmium-time-filter β€” filter OSM data by time from a history file πŸ¦‹


🌸 SYNOPSIS 🌸

osmium time-filter [OPTIONS] OSM-HISTORY-FILE [TIME]
osmium time-filter [OPTIONS] OSM-HISTORY-FILE FROM-TIME TO-TIME

πŸ’… DESCRIPTION πŸ’…

so basically, this command copies all objects that were valid at the given TIME, or in the time period between FROM-TIME (inclusive 🫢) and TO-TIME (not inclusive πŸ™…), from the input file into the output file. if you don't give it a time at all, it just uses the current time. lowkey iconic behavior.

usually INPUT-FILE is gonna be an OSM data file with history. and if you give it both FROM-TIME and TO-TIME, the result will also have history data, and it will also include deleted versions of objects. not me preserving the ghosts of data past πŸ’€

if you only gave a single point in time, the result will be a normal OSM file without history, and it contains no deleted objects. clean. pristine. main character energy.

the format for the timestamps is yyyy-mm-ddThh:mm:ssZ. memorize it, bestie.

this command reads its input file only once and writes its output file in one go, so it can be streamed β€” ie. it can read from STDIN and write to STDOUT. the efficiency? unmatched. periodt.

and okay here's a lil detail that matters: if the input file has a timestamp set in the header, and the specified TO-TIME is before that timestamp in the header, the header of the output file will have the timestamp set to the TO-TIME (or TO-TIME minus one second if a FROM-TIME was also set). it's giving precision. it's giving care. πŸŽ€


⭐ COMMON OPTIONS ⭐

  • -h, --help β€” show usage help. the classic. the icon. 🫢
  • -v, --verbose β€” set verbose mode. the program will output information about what it is doing to STDERR. she's narrating her 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. the silence is intentional πŸ¦‹

🌈 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. no favorites, everyone gets the same treatment πŸ‘‘

πŸŽ€ OUTPUT OPTIONS πŸŽ€

  • -f, --output-format=FORMAT β€” the format of the output file. can be used to set the output file format if it can't be autodetected from the output file name. see osmium-file-formats(5) or the libosmium manual for details. πŸ’–
  • --fsync β€” call fsync after writing the output file to force flushing buffers to disk. she's making SURE it's saved, no cap πŸ’Ύ
  • --generator=NAME β€” the name and version of the program generating the output file. it will be added to the header of the output file. default is "osmium/" and the version of osmium. little signature, cute πŸ–ŠοΈ
  • -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. consent first, always 🫢
  • --output-header=OPTION=VALUE β€” add output header option. this command line option can be used multiple times for different OPTIONs. see the osmium-output-headers(5) man page for a list of available header options. for some commands you can use the special format "OPTION!" (ie. an exclamation mark after the OPTION and no value set) to set the value to the same as in the input file. copy-paste but make it fancy ✨

😭 DIAGNOSTICS 😭

osmium time-filter exits with exit code

  1. 0 β€” if everything went alright, πŸŽ‰
  2. 1 β€” if there was an error processing the data, or πŸ’€
  3. 2 β€” if there was a problem with the command line arguments. πŸ™ˆ

🧚 MEMORY USAGE 🧚

osmium time-filter does all its work on the fly and doesn't keep much data in main memory. tiny footprint, huge impact. the way she doesn't hog your RAM? obsessed. πŸ”₯


πŸ’œ EXAMPLES πŸ’œ

extract current planet file from history planet:

osmium time-filter -o planet.osm.pbf history-planet.osh.pbf

extract planet data how it appeared on January 1 2008 from history planet:

osmium time-filter -o planet-20080101.osm.pbf history-planet.osh.pbf 2008-01-01T00:00:00Z

literally time travel. ate and left no crumbs 🌸


πŸ‘‘ 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. (the all-caps is theirs, and honestly it's valid, read the fine print bestie 🫢)


πŸ¦‹ CONTACT πŸ¦‹

if you have any questions or want to report a bug, please go to <https://osmcode.org/contact.html> β€” they don't bite, i promise πŸ™ˆ


⭐ AUTHORS ⭐

Jochen Topf <jochen@topf.org>. the legend. the blueprint. the moment. πŸ‘‘


okay that's the whole page!! this was osmium-time-filter, version 1.19.1 of the osmium manual set, and that's a wrap bestie πŸ’…βœ¨ go filter some history and be iconic about it πŸ’–

πŸ“¦ where this page comes from