Hi Is there a history recorder that shows when relations were added/removed from entities? Neither the main page history option of Deep History store such info. asked 28 Nov '18, 14:58 DaveF
showing 5 of 6
show 1 more comments
|
I'm also not aware of any tool that would show relation membership history for an entity. Tools like Deep History use the OSM API, but there is just the relations call that returns the current state only. What the Overpass API can do, is getting relation memberships at a certain time in the past with the date setting and a recurse up (<):
This query returns two multipolygon relations way 228444126 was part of at the time (currently none). You can also get the diff between two timestamps (or one timestamp and current state) with the adiff setting, e.g.:
The result is in the special Augmented Diff format (using "out tags" for brevity here).
The actions refer to the diff between two query results at the given timestamps. So action "delete" in our context means, that two relations were found in the past but not for the current state, i.e. the way is no longer member of those two relations. The visible flag indicates that the second meadow relation was actually deleted. Limitations:
answered 30 Nov '18, 11:56 ikonor |
Another approach is using the full history planet with the Osmium Tool OPL (Object Per Line) file format and UNIX command line tools. This is a bit more involved, but allows to retrieve the complete membership history. Geofabrik provides full history extracts (.osh.pbf). For our example we download oberbayern-internal.osh.pbf. On the command line we further extract a bounding box for the area of interest and output as OPL format (.opl):
Then we can filter for relations with the given entity in the members list using "grep". The "sed" formats the matching lines to print relation meta data and the entity member role:
The output for way 228444126:
OSM files are usually ordered by type, id, version. The grep "-A1" option also prints the next line after a match or a group of consecutive matches. If that extra line is the next version of the same relation, then the entity has been removed as member, or the relation deleted ("dD"). Otherwise, if the extra line is a different relation, then the last matching version is the current and the entity still a member. The last sed expression marks those extra lines where the entity is not a member with a hyphen ("-"). answered 02 Dec '18, 09:43 ikonor |
Just paste relation id to the following path: answered 21 Jan '21, 09:16 Cascafico The OP was searching for relations that had a specific node or way as member at some point in the past. T
(21 Jan '21, 09:45)
TZorn
ok, sorry I've been too short: in the result page, just search for element ID and you get the membership in's and out's in all the relation versions.
(21 Jan '21, 11:18)
Cascafico
The relation id is unknown, question comment quote:
(21 Jan '21, 15:27)
ikonor
|
The history display on the openstreetmap.org site should show changes to the members of relations, regardless of whether those members were relations or not. Can you give an example where this isn't the case?
I was thinking of a way/node where I want to know if any relation (not a specific one where the ID is known) has been removed. History of ways/nodes on openstreetmap.org only list the current relations added to the latest edit.
Oh okay, I thought you were asking about changes to the membership of relations, not the other way around. I'm not sure about any history that shows whether an object has been a member of a relation.
It'd be very difficult to detect - a changeset that removed a way from a relation would have only the new ways of the relation in it, not the old way.
Do you have an example (way/node id)? Do you have a specific use-case or question in mind?
I don't have an example precisely because of this problem. I don't know whether the node/way entities previously had relations attached or not. That's what I want to discover.