`delete` uses past instead of future version in OsmChange file
Closed this issue · 3 comments
<osmChange version="0.6" generator="osmium/1.14.0">
- The
delete
actions in an OsmChange file generated by Osmium contain the past (pre-change) version and timestamp of an element. create
andmodify
contain the future (post-change) version and timestamp.- The OsmChange wiki page does not specify the behavior.
- However,
osmdbt-create-diff/0.6
(which creates the planet diffs) uses future (post-change) version/timestamp for all three actions. - Osmium's approach makes it harder to determine the latest change if there are multiple
modify
actions for the same element, followed by adelete
; therefore, I think it should match the behavior ofosmdbt-create-diff
.
Can you give an example of the command line you are using and the input files?
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)
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)