Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var squareTasks = squares.map(square => {
// Clip the square with the input geometry. In this way we work with a
// smaller area..
let workArea = intersect(adminArea, square);
return createProcessAreaTask(workArea, poi, origins, osrm, maxTime, maxSpeed, id);
});
function noOverlaps(reference_polygon_feature, polygon_feature_array) {
for (feature_array_element of polygon_feature_array) {
let overlap_exists = intersect(reference_polygon_feature, feature_array_element);
if (overlap_exists) {
return false;
}
}
return true;
}
function noOverlaps(reference_polygon_feature, polygon_feature_array) {
for (feature_array_element of polygon_feature_array) {
let overlap_exists = intersect(reference_polygon_feature, feature_array_element);
if (overlap_exists) {
return false;
}
}
return true;
}
function verifyFeature(geometry, boundingBox) {
try {
if (geometry.type == 'Point') {
return geometry;
} else if (geometry.type == 'LineString') {
var intersect = LineIntersect(geometry, boundingBox.toGeoJSON().geometry);
if (intersect.features.length) {
return geometry;
} else if (BooleanWithin(geometry, boundingBox.toGeoJSON().geometry)) {
return geometry;
}
} else if (geometry.type == 'Polygon') {
var polyIntersect = Intersect(geometry, boundingBox.toGeoJSON().geometry);
if (polyIntersect) {
return geometry;
} else if (BooleanWithin(geometry, boundingBox.toGeoJSON().geometry)) {
return geometry;
}
}
} catch (e) {}
}