Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {}
}
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) {}
}