Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
flattenEach(geoJson, feature => {
featureOf(feature, 'LineString', 'Graph::fromGeoJson');
// When a LineString if formed by many segments, split them
coordReduce(feature, (prev, cur) => {
if (prev) {
const start = graph.getNode(prev),
end = graph.getNode(cur);
graph.addEdge(start, end);
}
return cur;
});
});
flattenEach(geoJson, function (feature) {
featureOf(feature, 'LineString', 'Graph::fromGeoJson');
// When a LineString if formed by many segments, split them
coordReduce(feature, function (prev, cur) {
if (prev) {
var start = graph.getNode(prev),
end = graph.getNode(cur);
graph.addEdge(start, end);
}
return cur;
});
});