0

I would like to access temporal information from OSM datafiles (not the changeset file)

Files *.osm.pbf downloaded from the GeoFabrik website or another OSM mirror do not show the following information:

  • Creation date
  • Last update date

I treat the data using gdal ogr*

How can I retrieve this information ?

2

Files at geofabrik.de do not have that metadata. You can collect your own metadata by checking also the corresponding web page when you download data. For example the latest data for Andorra is http://download.geofabrik.de/europe/albania-latest.osm.pbf and the web page http://download.geofabrik.de/europe/andorra.html informs

andorra-latest.osm.pbf, suitable for Osmium, Osmosis, imposm, osm2pgsql, mkgmap, and others. This file was last modified 12 hours ago and contains all OSM data up to 2020-10-19T20:42:02Z. File size: 1.6 MB; MD5 sum: 879e2fb46dd58f301f18986a1ecb7770.

If you have a pbf or osm-xml file and you do now know the age of it you can only scan the whole file and find the latest timestamp of any node, way, and relation. As you can see from the xml extract from Geofabrik, there are no timestamps about the whole file.

<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="osmium/1.8.0">
  <bounds minlat="42.4276" minlon="1.412368" maxlat="42.65717" maxlon="1.787481"/>
  <node id="625025" version="3" timestamp="2019-12-28T18:39:17Z" lat="42.5142133" lon="1.5527243"/>
  <node id="625026" version="2" timestamp="2014-04-16T13:38:15Z" lat="42.5144526" lon="1.5526978"/>
  <node id="625027" version="1" timestamp="2006-03-14T13:46:57Z" lat="42.5152372" lon="1.552978"/>
  <node id="625028" version="2" timestamp="2014-04-16T13:38:15Z" lat="42.5165425" lon="1.553585"/>
  <node id="625029" version="2" timestamp="2014-04-16T13:38:15Z" lat="42.5168939" lon="1.553855"/>
  <node id="625030" version="6" timestamp="2018-12-21T11:04:10Z" lat="42.517845" lon="1.5552446"/>
  <node id="625032" version="3" timestamp="2020-03-01T20:02:46Z" lat="42.5213647" lon="1.5587682"/>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.