Skip to content

Commit

Permalink
simplifying the code
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerwuster authored and bhousel committed Nov 14, 2024
1 parent 6a9d8df commit 955f699
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions modules/actions/sync_crossing_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ export function actionSyncCrossingTags(entityID) {

const node = graph.hasEntity(nodeID);
if (!node) continue;
if (node.isEndpoint(graph) && connectsToRoad(node, graph)) {
continue;
}
if (node.isEndpoint(graph)) continue;

if (isCrossingWay) { // Parent is a crossing - we are adding/updating crossing tags on childNodes..
let isCandidate = false;
for (const other of graph.parentWays(node)) {
Expand Down Expand Up @@ -188,17 +187,6 @@ export function actionSyncCrossingTags(entityID) {
}


function connectsToRoad(node, graph) {
// Check if the node connects to a road
const parentWays = graph.parentWays(node);
const connects = parentWays.some(way => {
const highwayTag = way.tags.highway;
return highwayTag && highwayTag !== 'footway' && highwayTag !== 'path';
});
return connects;
}


// Sync the tags to the child nodes..
const isInformalCrossing = ['informal', 'no'].includes(syncTags.crossing);
for (const child of childNodes) {
Expand Down

0 comments on commit 955f699

Please sign in to comment.