Search code examples
openstreetmapoverpass-api

OpenStreetMap queries on history?


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).


Solution

  • 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;