Handle situation where nodes have no loc (like in tests)

This commit is contained in:
Bryan Housel
2018-02-07 01:16:14 -05:00
parent 1007cfe252
commit 5ca56b6873

View File

@@ -345,9 +345,11 @@ export function osmIntersection(graph, startVertexId) {
n2 = vgraph.entity(way.nodes[0]);
}
var toLoc = geoVecInterp(n1.loc, n2.loc, 10); // extend 1000%
n2 = n2.move(toLoc);
vgraph = vgraph.replace(n2);
if (n1.loc && n2.loc) {
var toLoc = geoVecInterp(n1.loc, n2.loc, 10); // extend 1000%
n2 = n2.move(toLoc);
vgraph = vgraph.replace(n2);
}
});