turf
turf copied to clipboard
booleanIntersects obvious performance improvement
This bit of code could obviously be made faster with a non-exhaustive search
case "MultiPolygon":
segmentEach(feature1, (segment1) => {
segmentEach(feature2, (segment2) => {
if (lineIntersect(segment1!, segment2!).features.length) overlap++;
});
});
This should be:
case "MultiPolygon":
segmentEach(feature1, (segment1) => {
segmentEach(feature2, (segment2) => {
if (lineIntersect(segment1!, segment2!).features.length) return true;
});
});
Same in the case of LineString.