Automated edits/TTmechanicalupdates/Fix issue with duplicated inner polygons in New Zealand

From OpenStreetMap Wiki
Jump to navigation Jump to search

Who

TomTom team using TTmechanicalupdates bot account.

The team can be contacted at OSM@tomtom.com.

Why

Based on the Osmose Rule 1170 Class 1 "Double inner polygon" (the geometry of the multipolygon inner ring is duplicated: one is in a relation but without a tag and another has tags but is not part of the relation), we have detected approximately 17,579 such issues in New Zealand.

Example

Duplicated inner polygon example New Zealand.png

This example shows the relation with ID=4032186. This relation has 19 members, where one way with ID=302988135 (hereinafter referred to as Inner Ring Way) has a duplicating way ID=228019582 (hereinafter referred to as Duplicating Way) which is assigned to the same nodes as the Inner Ring Way, but is not a member of the relation (ID=4032186). In addition, the Inner Ring Way has no tags assigned, and the Duplicating Way has assigned tags, which would suggest that the Duplicating Way should be a member of relation ID=4032186.

Algorithm

The bot takes violations from Osmose (rule id 1170, class 1) "Double inner polygon" as input data. For each violation, data from OSM is fetched and violations are verified one more time.

Violations with common way ids (separate violations in Osmose, with repeating way id) are grouped into one changeset.

The following verifiers are executed:

  • all ways are closed,
  • all ways have the same nodes (direction of way digitalization and starting node can be different),
  • the duplicating way should have tags*,
  • the duplicating way is not a member of any relation,
  • inner ring ways should have no tags,
  • inner ring ways are a member of only 1 relation (the one from the Osmose violation).

*In case of multiple duplicating ways these violations will be skipped.

When a violation is confirmed by the bot, data modification is performed.

Data modification is understood as:

  • Basic scenario:
    • copying tags from the way, which does not belong to any relation to the way, which is a member of a violating relation,
    • removing way which does not belong to any relation.
  • Three or more duplicated ways scenario:
    • removing inner ring ways which belong to relations,
    • assigning a duplicating way to those relations.

The bot source code is available on GitHub.

Test run

Before running the bot on all violations logged in New Zealand, we will run the automated updates on a subset of violations. We will only fix approximately 100 cases of the total 17,579 cases logged by the Osmose rule.

Bot runs

We have detected 17,579 issues in the Osmose region of new_zealand, which we will fix in one go. This should not overload the system.

Discussion

This automated action was announced in the Talk-nz mailing list on May 2, 2022. We invite everyone to join the conversation and share feedback.

Opt-out

To opt out of this automated update, please write an e-mail (in English) to TTmechanicalupdates@groups.tomtom.com describing which area or source version should be excluded from the update scope and why.

When

Full run

The bot run on the remaining cases of duplicate inner polygons (not fixed during the test run) starts on May 16, 2022.

Test run

The test run was completed on May 9, 2022.

Outcome

Summary of test run and full run

Opened changesets Total violations Fixed violations Not fixed violations
373 17,574 17,377 197

Full run details

Scope: New Zealand

Start date: May 16, 2022

Number of runs: 2

Violations source date: May 16, 2022 (run 1); May 19, 2022 (run 2)

Below you can see the results of the full bot run:

Run number Run date Opened changesets Total violations Fixed violations Found duplicates* Fixed duplicates Filtered out by verifiers** Others rejected***
1 2022-05-16 349 16,498 16,308 210 132 0 134 (both ways are member of different relations)
2 2022-05-19 22 1,166 973 74 0 0

*Found duplicates - cases were there are more than 2 duplicated ways

**Filtered out by verifiers - cases which are rejected because they are not passing all the algorithm criteria

***Others rejected - other reasons of rejection, usually incomplete data, not solvable in an automatic way

Test run details

Scope: New Zealand, 100 violations taken from Osmose

Start date: May 9, 2022

Violations source date: May 9, 2022

Total violation count: 100

Uploaded fixes: 96

Filtered out due to duplicated way id: 0

Incomplete data (both ways are different relation members): 4

Total opened changesets: 2 (120750515, 120750548)

Total time of run: app. 1 minute