Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(data, tile, writeData, done) {
// Load an rbush with the existing OSM buildings
var osmCover = rbush();
for (let feature of data.osm.osm.features) {
if (feature.geometry.type !== 'Polygon' || !feature.properties.building) {
continue;
}
osmCover.insert(feature);
}
var features = [];
for (let bFeature of data.buildings.bingbuildings.features) {
var bingOsmIntersect = osmCover.search(bFeature);
if (bingOsmIntersect.features.length == 0) {
// No intersection in the rbush means we should just write out the building
features.push(bFeature);
continue;