Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const sourceList = sourceFeatures.filter(f => {
//console.log("f: " + Turf.area(f));
// There might be areas too tiny to be useful and they crash Turf.intersect(featureSimpl, f);
if (Turf.area(f) < 180) { // TODO: sinnvollen Wert (à la 1cm) für minimale Fläche finden. Mit 0.1e-10 scheint gut für wenige Testdaten Berlin
console.log("Dropping Feature with tiny area");
return;
}
let intersection = Turf.intersect(featureSimpl, f); // This crashes if f is really really small or something. 23.1.2017
if(!isUndefined(intersection)) {
intersection = arealizeGeometryCollection(intersection);
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection)// && f.properties.binary !== 0;
});
var derivedFrom = [];
do {
multiplier *= 1.05;
circlesTooSmallForIntersection = 0;
noOfTrueIntersections = 1;
derivedFrom = [];
// First intersection is just the first circle itself
intersection = locationToCircle(locs[0], multiplier);
derivedFrom.push(locs[0]);
// Loop through all available locations/circles
for(var i=1; i= 3);
return {
"centroid": turf.centroid(intersection),
tileLayer.layers.forEach(function(layer){
layers[layer] = turf.featurecollection([]);
if (vt && vt.layers[layer]) {
for (var i = 0; i < vt.layers[layer].length; i++) {
f = vt.layers[layer].feature(i).toGeoJSON(tile[0],tile[1],tile[2]);
try {
if (tileLayer.overzoom) {
bbox = turf.polygon(tilebelt.tileToGeoJSON(childTile).coordinates);
if (f.geometry.type === 'Point') {
if (turf.inside(f, bbox)) layers[layer].features.push(f);
} else {
// Clip features of parent tile to child tile
var clipped = turf.intersect(f, bbox);
if (clipped) {
clipped.properties = f.properties;
layers[layer].features.push(clipped);
}
}
} else {
layers[layer].features.push(f);
}
} catch(e) {
cb(e, null);
}
}
}
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(featureSimpl, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});
b.features.forEach(e => {
const isIntersect = Turf.intersect(d, e);
if(isIntersect && Turf.area(isIntersect) > 0) {
isIntersect.properties = objectAssign({}, e.properties, d.properties);
isIntersect.properties.parentArea = Turf.area(d);
resultFeatures.push(isIntersect);
}
});
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(featureSimpl, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(targetFeature, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(targetFeature, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(featureSimpl, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});
const sourceList = sourceFeatures.filter(f => {
let intersection = Turf.intersect(featureSimpl, f);
if(!isUndefined(intersection)) {
intersection.properties = f.properties;
if(f.properties.binary !== 0) {
intersects.push(intersection);
}
}
return !isUndefined(intersection) && f.properties.binary !== 0;
});