Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.filter(feature => {
try {
return (
// Technically, we're doing more than an overlap comparison here.
// `boooleanOverlap` returns features which are strictly overlapping; we
// also want to return features which are entirely contained by the
// buffer.
booleanOverlap(bufferFeature, feature) ||
booleanContains(bufferFeature, feature)
);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
Mixpanel.track("Error", {
message:
"unable to perform booleanOverlap and booleanContains on features",
error: e,
});
return false;
}
})
.reduce(
return (fieldPolygon: any) => intersect(fieldPolygon, queryPolygon);
}
var closestNumber = closestGreaterNumber(matchFeaturePosition, originalIndexOfItemsRemoved);
if (closestNumber !== 0) {
matchFeaturePosition = matchFeaturePosition - closestNumber;
}
}
}
if (matchFeaturePosition === +i) return;
var matchFeature = features[matchFeaturePosition];
if (!matchFeature || !polygon) return;
if (propertyName !== undefined &&
matchFeature.properties[propertyName] !== polygon.properties[propertyName]) return;
if (!overlap(polygon, matchFeature) || !ringsIntersect(polygon, matchFeature)) return;
features[i] = turfUnion(polygon, matchFeature);
originalIndexOfItemsRemoved.push(potentialMatchingFeature.properties.origIndexPosition);
originalIndexOfItemsRemoved.sort(function (a, b) {
return a - b;
});
tree.remove(potentialMatchingFeature);
features.splice(matchFeaturePosition, 1);
polygon.properties.origIndexPosition = i;
tree.remove(polygon, function (a, b) {
return a.properties.origIndexPosition === b.properties.origIndexPosition;
});
featureChanged = true;
});