Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle via-way restrictions with multiple from/to ways correctly (no_entry/no_exit) #3100

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

easbar
Copy link
Member

@easbar easbar commented Jan 3, 2025

Fixes #3086.

The exception was caused by an extremely rare type of restriction: a via-way restriction with multiple from-ways (restriction=no_entry). The following overpass query finds such restrictions:

relation[type=restriction](if:count_by_role("from") > 1);
foreach -> .r (
  way(r.r:via);
  if (count(ways) > 0) {
    .r out geom;
  }
);

Currently there are 54. But they are all invalid for various reasons like missing from/to-members, disconnected member ways etc. so we ignore them anyway. There is only one exception, namely the one that has been added only recently and caused the error. That one isn't strictly necessary, because the desired turn restrictions could be represented with a simpler mapping, but it is 'correct' tagging nonetheless. Sidenote: This specific restriction is also time-dependent, so it will typically be ignored.

Still, I somewhat see how this type of mapping can be useful and since we already had everything required in place I did not simply ignore these via-way no_entry/no_exit restrictions but added support for them.

@easbar easbar added this to the 11.0 milestone Jan 3, 2025
@easbar easbar merged commit a9e7ced into master Jan 3, 2025
4 checks passed
@easbar easbar deleted the via_way_restriction_multiple_from branch January 3, 2025 17:56
easbar added a commit that referenced this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IllegalArgumentException in RestrictionTopology for planet import
1 participant