Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Ways are assigned to incorrect changesets when their nodes move #2

Open
mojodna opened this issue Nov 29, 2017 · 1 comment
Open

Ways are assigned to incorrect changesets when their nodes move #2

mojodna opened this issue Nov 29, 2017 · 1 comment

Comments

@mojodna
Copy link

mojodna commented Nov 29, 2017

When a node (501609671) associated with a way (41113036) is moved, the way appears in Overpass's augmented diff output as though it changed (which its geometry did), e.g.

<action type="modify">
<old>
  <way id="41113036" version="1" timestamp="2009-09-19T10:30:53Z" changeset="2532203" uid="110076" us
    <bounds minlat="41.8432372" minlon="12.6208508" maxlat="41.8432812" maxlon="12.6210011"/>
    <nd ref="501609670" lat="41.8432812" lon="12.6210011"/>
    <nd ref="501609671" lat="41.8432372" lon="12.6208508"/>
    <tag k="highway" v="service"/>
  </way>
</old>
<new>
  <way id="41113036" version="1" timestamp="2009-09-19T10:30:53Z" changeset="2532203" uid="110076" us
    <bounds minlat="41.8432288" minlon="12.6208433" maxlat="41.8432812" maxlon="12.6210011"/>
    <nd ref="501609670" lat="41.8432812" lon="12.6210011"/>
    <nd ref="501609671" lat="41.8432288" lon="12.6208433"/>
    <tag k="highway" v="service"/>
  </way>
</new>
</action>

However, the only changeset visible in this fragment (2532203) is the changeset in which the way was originally created. As a result, osm-adiff-parser credits the original changeset (2532203) with the modification rather than the changeset which actually modified the geometry (54135745, per http://www.openstreetmap.org/node/501609671).

The clue here that the way shouldn't be credited to its original changeset is that version didn't change. Given that, it becomes necessary to look through the current augmented diff for entries corresponding to any of the referenced ways and use the associated changeset id as the target.

This is touched on indirectly by drolbr/Overpass-API#407. Addressing the problem upstream would likely involve including some indicator about which component was modified such as additional metadata for each nd ref (version, changeset, timestamp, etc.).

@nrenner
Copy link

nrenner commented Jan 23, 2018

A nice example for this issue is changeset 54743987.

Current

Changeset Map:

screenshot-2018-1-23 changeset map

Expected

achavi:

screenshot-2018-1-23 achavi - augmented osm change viewer attic

See also OSM History Viewer.
By the way: History Viewer has a nice feature highlighting only the changed segments of a way (old red, new green), with unchanged segments in a different color (blue).

Examples

Four ways are shown, because their node refs changed and therefore they are included in the changeset, e.g.:

All other ways are not shown, because only the coordinates of their nodes changed, e.g.:

I wondered whether the chached JSON files on S3 of the wrongly attributed, original way changeset are updated and how, so I checked for way 153245700 and changeset 53896180:
https://s3.amazonaws.com/mapbox/real-changesets/production/53896180.json

  • contains way 153245700 only once --> Ok
  • apparently also wasn't updated:
    • closed_at="2017-11-18T10:14:49Z" (changeset 53896180)
    • Last-Modified: Sat, 18 Nov 2017 10:18:40 GMT (curl --head .../53896180.json)
    • closed_at="2017-12-18T22:22:12Z" (example changeset 54743987 a month later)
    • --> Ok

Context

Achavi - when filtering for a specific changeset - includes a way if its versions are the same and one of its nodes is in the changeset.

This issue also applies to relations when members change their geometries:

Relations are considered as changed when their members have changed or one of its way members has changed by its members or coordinates or one of the node members has changed its coordinate. By contrast, changes on members of type relation don't propagate to their parent relations.

https://wiki.openstreetmap.org/wiki/Overpass_API/Augmented_Diffs#Contained_data

cc @batpad @willemarcel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants