Repository metrics
- Stars
- (3,818 stars)
- PR merge metrics
- (Avg merge 29d 14h) (82 merged PRs in 30d)
Description
Description
When nodes or ways that are used as members of relations with type=restriction are edited or deleted these relations can become broken. Maybe this is something that should be validated, so a warning will be shown if restrictions are broken?
According to the wiki such validation should check that every relation of type=restriction:
- has one or more members with role 'from' and type 'way'
- has one or more members with role 'to' and type 'way'
- has exactly one member with role 'via' and type 'node' or one or more members with role 'via' and type 'way'
If we wanted to go further also these things could be validated:
- there should be no members with roles other than 'from', 'to' and 'via', which means also no members with an empty role. the only exception might be the
location_hintrole, but it is already deprecated in the wiki - there should never be more than one member with role 'from' and more than one member with role 'to'
- all members with role 'via' must be connected with each other if they are ways
- probably easy: all members with role 'from' and 'to' must be connected with the member with role 'via', if it is a node. the via node must be the first or last node of the from/to member ways (ways must be split at the via node).
- probably harder: all members with role 'from' and to 'to' must be connected with the via members if they are ways.
I found about 20000 restriction relations that have no from or to member in the current planet OSM file (this seems to be the most frequent issue). Many I looked at used to have these members, but then they were deleted, because someone edited some ways in that area, and often used iD for this.
If you think this is useful I could try to provide a PR that does this.