allow splitting of closed roundabout for certain rel types

This commit is contained in:
Martin Raifer
2024-03-05 13:40:37 +01:00
parent 13d46b0578
commit 296ce859cf
2 changed files with 101 additions and 29 deletions
+3 -2
View File
@@ -422,13 +422,14 @@ export function actionSplit(nodeIds, newWayIds) {
if (parentRelation.members[i].id === way.id) {
const memberBeforePresent = i > 0 && graph.hasEntity(parentRelation.members[i - 1].id);
const memberAfterPresent = i < parentRelation.members.length - 1 && graph.hasEntity(parentRelation.members[i + 1].id);
if (!memberBeforePresent && !memberAfterPresent) {
if (!memberBeforePresent && !memberAfterPresent && parentRelation.members.length > 1) {
return 'parent_incomplete';
}
}
}
}
if (way.tags.junction === 'roundabout' && way.isClosed()) {
const relTypesExceptions = ['junction', 'enforcement']; // some relation types should not prehibit a member from being split
if (way.tags.junction === 'roundabout' && way.isClosed() && !relTypesExceptions.includes(parentRelation.tags.type)) {
return 'simple_roundabout';
}
}