achavi
achavi copied to clipboard
Support creating/viewing diffs from local files
Is it possible to support uploading local files and then create/render a diff from them, please? For example, suppose I see one user with 1000 small changesets and I would like to review them; doing this one-by-one with achavi would be inefficient (not due to achavi, but due to the amount of changesets with small changes).
Now suppose that I download all of his osmChanges, merge them with osmium merge-changes -F osc -f osm -o merged.osc <all his osmchanges.osc> and open this local file with the achavi interface.
We would be able to view the before and after of all his 1000 changesets, in just one single page.
This would help a lot (really a lot) with things like https://github.com/openstreetmap/iD/issues/2251#issuecomment-180469767 and https://lists.openstreetmap.org/pipermail/talk/2018-January/080040.html
Could it be possible to do something like this? :-)
A bit curious about this approach: what exactly is the benefit of downloading all those changesets, merge them locally and upload to achavi again, rather than just providing a list of changeset ids to achavi in the first place?
We would be able to view the before and after of all his 1000 changesets
Are you sure about this? Wouldn't it make more sense to check the start/end timestamp of each single changeset instead, or at least group them a bit by time and bounding box?
There might be a huge volume of data to be processed on Overpass API, if you try to process all changes in a large bounding box across a timeframe of several days, which could easily happen with 1000 changesets. This in turn would exceed timeout and memory limits, e.g. not really feasible.
I also assume that you would need new 0.7.55 features for this (similar to this one), to avoid sending queries for each single changeset and quickly running into HTTP 429 errors. In addition, I would recommend to download each individual object in such cases (see https://github.com/nrenner/achavi/issues/9)
There is no UI element for this, but you already can load files:
- drag & drop a local file onto the map
- pass a URL to a file or resource with the
urlparameter,
e.g. .../achavi/?url=http://.../charging_stations.xml
(with limitations due to cross-origin security constraints)
The file needs to be in the Augmented Diff format though, as returned by the Overpass API adiff query.
The osmChange format is currently also supported, but it isn't enough to create/render a proper diff, as there is a lot of information missing. For example, when the nodes of a way are only moved, the way object itself doesn't change, i.e. it doesn't increase its version and is not included in the changeset. Here is a nice example for this case:
- https://overpass-api.de/achavi/?changeset=54743987
- https://overpass-api.de/achavi/?url=https://www.openstreetmap.org/api/0.6/changeset/54743987/download
What achavi does is getting the changeset metadata and creating an adiff query for the Overpass API that does the actual work of creating a diff with all the necessary information (with some filtering and additional work on the client):
[adiff:"2017-12-18T22:22:09Z","2017-12-18T22:22:12Z"];
(
node(bbox)(changed);
way(bbox)(changed);
);
out meta geom(bbox);
&bbox=-92.3132738,38.9463836,-92.2983936,38.9534851
So what you really would need to do, is to generate and aggregate adiff queries and their results, see @mmd-osm 's comment.
It would be a useful feature to add, but I'm not sure about the future of achavi, especially regarding the changeset part.
An alternative is OSMCha ¹, which has a user filter for the list of changesets, but you still need to look at each seperately. What is missing is a way to select and visualize multiple changesets at once. Don't know how hard it is to extend the visualization part, which is done by changeset-map. Collecting all the diffs should be straightforward and not stressing any server much, as newer changesets are cached in the cloud in a JSON format derived from augmented diffs, e.g. 54743987.json, see also geohacker diary.
I would suggest to open a feature request there.
¹ not really for our example 54743987 unfortunately, there seems to be a bug/missing feature
@mmd-osm It would be better if achavi could automate everything, for sure. Maybe what I was thinking is that this feature wouldn't be used by most of people and that it maybe would relieve some burden from requesting every changeset from Overpass (and thus pre-processing everything could make things easier somehow at achavi's side)
(and I also didn't even know that the adiff and the osmChange were different) :-)