Improve osm_date
to report date from PBF metadata
#388
Labels
enhancement
New feature or request
Milestone
Details
Current Status
Version 1.0.2
Version TBD
Description
The
osm.pgosm_flex
table tracks theosm_date
column which is intended to provide an idea of when the data itself was from. The current behavior defaults to "today's date" according to the computer running the import by default. Unless the--pgosm-date
option is used, then it uses the date provided (e.g.2024-05-18
). Neither of these options is perfect, due to time zones and actual differences between when "I downloaded the file" vs "when the data was pulled from OSM."I'd like to make the following changes.
osmium fileinfo
to retrieve the timestamp from the pbf metdata when it existsosm_date
totimestamptz
instead ofdate
Example in DB
I ran an import on 5/18/2024 local time. The data saved in the
osm.pgosm_flex
table is shown by the following query.PBF metadata
The timestamp from the pbf's metadata is reported as
2024-05-17T20:20:59Z
, which is2024-05-17T14:20:59 MDT
local time for me. The date reported in the current method is reported to be a day later when the data was actually sourced.We should be able to run this command returning the JSON into python as a
dict
to extract thetimestamp
and/orosmosis_replication_timestamp
keys.The text was updated successfully, but these errors were encountered: