Skip to content

Commit 6a9d8df

Browse files
tannerwusterbhousel
authored andcommitted
Prevent crossing tag suggestions for nodes connecting to roads
- Updated logic to skip nodes that are endpoints connecting to roads when syncing crossing tags. - Ensured that crossing tags are only suggested for appropriate nodes.
1 parent a011ddc commit 6a9d8df

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

modules/actions/sync_crossing_tags.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export function actionSyncCrossingTags(entityID) {
156156

157157
const node = graph.hasEntity(nodeID);
158158
if (!node) continue;
159-
159+
if (node.isEndpoint(graph) && connectsToRoad(node, graph)) {
160+
continue;
161+
}
160162
if (isCrossingWay) { // Parent is a crossing - we are adding/updating crossing tags on childNodes..
161163
let isCandidate = false;
162164
for (const other of graph.parentWays(node)) {
@@ -186,6 +188,17 @@ export function actionSyncCrossingTags(entityID) {
186188
}
187189

188190

191+
function connectsToRoad(node, graph) {
192+
// Check if the node connects to a road
193+
const parentWays = graph.parentWays(node);
194+
const connects = parentWays.some(way => {
195+
const highwayTag = way.tags.highway;
196+
return highwayTag && highwayTag !== 'footway' && highwayTag !== 'path';
197+
});
198+
return connects;
199+
}
200+
201+
189202
// Sync the tags to the child nodes..
190203
const isInformalCrossing = ['informal', 'no'].includes(syncTags.crossing);
191204
for (const child of childNodes) {

0 commit comments

Comments
 (0)