osmcode / osmium-tool

Command line tool for working with OpenStreetMap data based on the Osmium library.
https://osmcode.org/osmium-tool/
GNU General Public License v3.0
483 stars 104 forks source link

`delete` uses past instead of future version in OsmChange file #261

Closed clarisma closed 1 year ago

clarisma commented 1 year ago

<osmChange version="0.6" generator="osmium/1.14.0">

joto commented 1 year ago

Can you give an example of the command line you are using and the input files?

clarisma commented 1 year ago

I didn't run this myself, I noticed this in files downloaded from Geofabrik: http://download.geofabrik.de/europe/france/provence-alpes-cote-d-azur-updates/

(Specifically, in replication number 3574, as well as in the daily updates 10 days ago)

clarisma commented 1 year ago

I think I know what's going on: For extracts, Geofabrik creates diffs between the latest PBF and the one from the previous day, so Osmium doesn't have any information about the timestamp of the deletion (which is only stored on the OSM server or in history files) -- it only knows that a particular element from the previous PBF is not contained in the current PBF.

~Still, would it make more sense to increment the version number and use the timestamp of the latest PBF as the delete timestamp?~

Never mind. There are two command-line options: --increment-version and --update-timestamp (https://docs.osmcode.org/osmium/v1.14.0/osmium-derive-changes.html)