Skip to content

Commit 56146ce

Browse files
committed
revert last commit
1 parent bdc278c commit 56146ce

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

modules/validations/curb_nodes.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,10 @@ export function validationCurbNodes(context) {
150150
if (hasCurbNode(node, graph)) {
151151
return; // Exit if curb already exists
152152
}
153-
// Determine if the node is the first or last in the way
154-
const isFirstNode = way.nodes[0] === node.id;
155-
const isLastNode = way.nodes[way.nodes.length - 1] === node.id;
156153
// Calculate the position for the new curb node
157154
const nodeIndex = way.nodes.indexOf(node.id);
158-
const adjacentNode = isFirstNode
159-
? graph.entity(way.nodes[nodeIndex + 1])
160-
: graph.entity(way.nodes[nodeIndex - 1]);
161-
const newNodePosition = calculateNewNodePosition(node, adjacentNode, 1, isLastNode);
155+
const adjacentNode = graph.entity(way.nodes[nodeIndex + 1] || way.nodes[nodeIndex - 1]);
156+
const newNodePosition = calculateNewNodePosition(node, adjacentNode, 1);
162157
// Find connected ways and select the appropriate tags
163158
const connectedWays = graph.parentWays(node);
164159
let connectedWayTags = null;
@@ -168,10 +163,6 @@ export function validationCurbNodes(context) {
168163
break;
169164
}
170165
}
171-
if (!connectedWayTags) {
172-
console.warn('No connected non-crossing way found');
173-
return;
174-
}
175166
// Create a new curb node with the specified curb tags
176167
const newCurbNode = osmNode({ loc: [newNodePosition.lon, newNodePosition.lat], tags: curbTags, visible: true });
177168
// Add the new node to the graph
@@ -313,4 +304,4 @@ export function validationCurbNodes(context) {
313304
validation.type = type;
314305

315306
return validation;
316-
}
307+
}

0 commit comments

Comments
 (0)