How to use the geojson-rbush.default function in geojson-rbush

To help you get started, we’ve selected a few geojson-rbush examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iandees / building-diff / map.js View on Github external
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;

geojson-rbush

GeoJSON implementation of RBush

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis

Popular geojson-rbush functions