achavi
achavi copied to clipboard
Overlapping changesets
As Overpass API does not support querying for changesets, achavi queries by timeframe and bbox of the changeset and filters the result by changeset id on the client. This does not work when there are multiple changesets modifying the same objects, because adiff
returns aggregated changes.
Example (from mmd-osm): Modified way 31664569 (added nodes) in changeset 27183569 is not shown in achavi.
This changeset is a weird example because it seems all created objects (esp. new builings) were uploaded twice in changesets 27183569 and 27183716. So visualization in achavi is not as wrong as it looks at first sight.
changeset 27183569:
-
OSM API: https://www.openstreetmap.org/api/0.6/changeset/27183569/download
<modify> <way id="31664569" changeset="27183569" timestamp="2014-12-02T16:40:01Z" version="4" ...
-
https://overpass-api.de/api/interpreter?data= [adiff:"2014-12-02T16:36:27Z","2014-12-02T17:40:02Z"]; (node(bbox)(changed);way(bbox)(changed);); out meta geom(bbox); &bbox=6.7306185,49.2351097,6.7979623,49.2734277
<action type="modify"> <old><way id="31664569" version="3" timestamp="2012-05-23T17:05:18Z" changeset="11682467" ... <new><way id="31664569" version="5" timestamp="2014-12-02T17:31:16Z" changeset="27184613" ...
Because a later change is included in the adiff result, version 4 and 5 are aggregated under changeset 27184613. This is why filtering for changeset 27183569 in achavi does not include this way.
Overlapping changesets by the same user (first closed after the third):
changeset id="27183569" created_at="2014-12-02T16:36:28Z" closed_at="2014-12-02T17:40:02Z"
changeset id="27183716" created_at="2014-12-02T16:44:09Z" closed_at="2014-12-02T17:07:43Z"
changeset id="27184613" created_at="2014-12-02T17:31:12Z" closed_at="2014-12-02T17:31:18Z"
Object timestamps in changeset 27183569 range from 2014-12-02T16:36:36Z to 2014-12-02T16:40:02Z, i.e. there are no overlapping uploads, the changeset just timed out an hour later.
Passing a modified query without timeout to achavi shows the correct changes.
Other examples in this changeset are way 250937385 (tags modified twice) and node 1564054893 (moved twice).
See also wiki page Overlapping changesets analysis of some first search for further examples. It seems to indicate that this might happen more often than I first thought.
What do you think about this dirty solution:
- First call the OSM API. Example:
http://www.openstreetmap.org/api/0.6/changeset/35414022/download
- Then collect all the node/way/relation ids from the result. Example:
way:371860167;way:203395921
- Then build and run the overpass API query with these ids. Example:
https://overpass-api.de/api/interpreter?data=
[adiff:"2014-12-02T16:36:27Z","2016-01-11T17:40:02Z"];
(way(371860167);way(203395921));
out meta geom;
Maybe I don't get the idea, but I don't see how this would help with overlapping changes (aggregated versions). Given the example changeset 27169290, this id query would still return version 2 of changeset 27169302:
[adiff:"2014-12-02T00:01:55Z","2014-12-02T01:02:13Z"];
(node(3215109947);node(3215113580));
out meta geom;
Generally, I would want to avoid bothering the main OSM API, and I guess the OsmChange download is rather expensive. But I could imagine using it as a fallback for problematic changesets.
Maybe you intended to comment on #9 instead, where it might help for large and long changesets, e.g. for CS 28764270 ((changed)
only still seems faster in this case)?