booleanIntersects obvious performance improvement
stevage opened this issue · comments
Steve Bennett commented
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
.