6

I would like to get a list of modifications on the OSM database, in a given bounding box, between two given dates and impacting a given set of tags.

Does anyone know how to do this?

Any command-line tool, webapp such as Overpass Turbo, or query API such as XAPI?

I have seen it's possible to get history of a map by its location and zoom level (example: http://www.openstreetmap.org/history#map=16/45.9605/5.3391 ), but this return groups of modification that contains modifications outside of the current map).

I have also seen a history browser to browse history of a given object (node, way or relation).

2

2 Answers 2

5

The best solution we found is to use Overpass-Turbo "diff" functionnality.

Here is the XML script I use to get changes on roads in a given bounding box, between 2 dates:

<osm-script date="2014-09-21T15:00:00Z" from="2012-09-14T15:00:00Z">
  <union>
    <query type="way">
      <has-kv k="highway"/>
    <bbox-query {{bbox}}/>
    </query>
  </union>
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

And here is the equivalent in Overpass QL:

[diff:"2012-09-14T15:00:00Z","2014-09-21T15:00:00Z"];
(
  way["highway"]({{bbox}});
);
out body;
>;
out skel qt;
3

You can look at the OSM-Full-History-Dump File. Every change that has been made ever to an osm feature (geometry or attributes) is saved in this file.

Using the OSM-History-Splitter (https://github.com/MaZderMind/osm-history-splitter) to clip the OSM history file to a BBOX and use the OSM-History-Importer (https://github.com/MaZderMind/osm-history-renderer) to import the clipped file into a PostGIS databse. You can download some pre-clipped files from here (http://osm.personalwerk.de/full-history-extracts/lates). However, you can't import relations as there are not yet supported by the tool.

Some time ago I wrote a tool called iOSMAnalyzer (https://github.com/zehpunktbarron/iOSMAnalyzer). With this, it is possible to run intrinsic OpenStreetMap analyses based on the OSM-Full-History file. I'd recommend to only use the SQLs within the scripts because the tool itself is very buggy as I'm not familiar with coding.

1
  • 3
    For a beginner, working with an OSM Full history dump file is really daunting due to its file size (42GB(!) in pbf format). I'd really recommend to check Overpass Attic features diff and adiff as @scai already pointed out before.
    – mmd
    Commented Jan 21, 2015 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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