{"name":"geojson-rbush","version":"3.1.1","description":"GeoJSON implementation of RBush","main":"index","types":"index.d.ts","files":["index.js","index.d.ts"],"scripts":{"pretest":"tsc types.ts","test":"tap test.js --coverage","bench":"node bench.js","docs":"documentation readme index.js --section=API"},"keywords":["geojson","index","tree","spatial","rbush"],"author":{"name":"Denis Carriere","email":"@DenisCarriere"},"contributors":[{"name":"Vladimir Agafonkin","email":"@mourner"},{"name":"Denis Carriere","email":"@DenisCarriere"},{"name":"Jordan Rousseau","email":"@jvrousseau"}],"license":"MIT","devDependencies":{"@turf/bbox-polygon":"*","@turf/random":"*","@types/node":"*","benchmark":"*","documentation":"*","load-json-file":"*","tap":"*","tape":"*","typescript":"*","write-json-file":"*"},"dependencies":{"@turf/bbox":"*","@turf/helpers":"6.x","@turf/meta":"6.x","rbush":"*"},"gitHead":"4fe64bbebc9b2025045da26b749e109e07e14b04","_id":"geojson-rbush@3.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"deniscarriere","email":"carriere.denis@gmail.com"},"dist":{"integrity":"sha512-Bl6U75yDCsERl2P6PiBkvxIoXsSv5SEEiDJy+a7JarcEe17jEm8zamAmi82KLRcIlcuRZxgeVCl1xw5UkxOREw==","shasum":"dd40bdd26e92813d888d7b489e8d2980695a49b4","tarball":"http://registry-npm.ywwl.com/geojson-rbush/download/geojson-rbush-3.1.1.tgz","fileCount":6,"unpackedSize":15711,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/WKv/geQAdm/FSLfShkGqVLxXcMchxaXX493a1b9LngIgOG3M60RPWaWhyMmocNnZWOFvAcuRgvLlyRsenRnQC/0="}],"size":4617,"noattachment":false,"key":"/geojson-rbush/-/geojson-rbush-3.1.1.tgz"},"maintainers":[{"name":"deniscarriere","email":"carriere.denis@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-rbush_3.1.1_1518624152373_0.22133734323893117"},"_hasShrinkwrap":false,"readme":"# GeoJSON RBush\n\n[![Build Status](https://travis-ci.org/DenisCarriere/geojson-rbush.svg?branch=master)](https://travis-ci.org/DenisCarriere/geojson-rbush)\n[![npm version](https://badge.fury.io/js/geojson-rbush.svg)](https://badge.fury.io/js/geojson-rbush)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/geojson-rbush/master/LICENSE)\n\nGeoJSON implementation of [RBush](https://github.com/mourner/rbush) — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles.\n\n## Install\n\n**npm**\n\n```bash\n$ npm install --save geojson-rbush\n```\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n-   [rbush](#rbush)\n-   [insert](#insert)\n-   [load](#load)\n-   [remove](#remove)\n-   [clear](#clear)\n-   [search](#search)\n-   [collides](#collides)\n-   [all](#all)\n-   [toJSON](#tojson)\n-   [fromJSON](#fromjson)\n\n### rbush\n\nGeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n\n**Parameters**\n\n-   `maxEntries` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** defines the maximum number of entries in a tree node. 9 (used by default) is a\n    reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa. (optional, default `9`)\n\n**Examples**\n\n```javascript\nvar geojsonRbush = require('geojson-rbush').default;\nvar tree = geojsonRbush();\n```\n\nReturns **RBush** GeoJSON RBush\n\n### insert\n\n[insert](https://github.com/mourner/rbush#data-format)\n\n**Parameters**\n\n-   `feature` **Feature** insert single GeoJSON Feature\n\n**Examples**\n\n```javascript\nvar poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\ntree.insert(poly)\n```\n\nReturns **RBush** GeoJSON RBush\n\n### load\n\n[load](https://github.com/mourner/rbush#bulk-inserting-data)\n\n**Parameters**\n\n-   `features` **(FeatureCollection | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;Feature>)** load entire GeoJSON FeatureCollection\n\n**Examples**\n\n```javascript\nvar polys = turf.polygons([\n    [[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]],\n    [[[-93, 32], [-83, 32], [-83, 39], [-93, 39], [-93, 32]]]\n]);\ntree.load(polys);\n```\n\nReturns **RBush** GeoJSON RBush\n\n### remove\n\n[remove](https://github.com/mourner/rbush#removing-data)\n\n**Parameters**\n\n-   `feature` **Feature** remove single GeoJSON Feature\n-   `equals` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pass a custom equals function to compare by value for removal.\n\n**Examples**\n\n```javascript\nvar poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n\ntree.remove(poly);\n```\n\nReturns **RBush** GeoJSON RBush\n\n### clear\n\n[clear](https://github.com/mourner/rbush#removing-data)\n\n**Examples**\n\n```javascript\ntree.clear()\n```\n\nReturns **RBush** GeoJSON Rbush\n\n### search\n\n[search](https://github.com/mourner/rbush#search)\n\n**Parameters**\n\n-   `geojson` **(BBox | FeatureCollection | Feature)** search with GeoJSON\n\n**Examples**\n\n```javascript\nvar poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n\ntree.search(poly);\n```\n\nReturns **FeatureCollection** all features that intersects with the given GeoJSON.\n\n### collides\n\n[collides](https://github.com/mourner/rbush#collisions)\n\n**Parameters**\n\n-   `geojson` **(BBox | FeatureCollection | Feature)** collides with GeoJSON\n\n**Examples**\n\n```javascript\nvar poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n\ntree.collides(poly);\n```\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if there are any items intersecting the given GeoJSON, otherwise false.\n\n### all\n\n[all](https://github.com/mourner/rbush#search)\n\n**Examples**\n\n```javascript\ntree.all()\n```\n\nReturns **FeatureCollection** all the features in RBush\n\n### toJSON\n\n[toJSON](https://github.com/mourner/rbush#export-and-import)\n\n**Examples**\n\n```javascript\nvar exported = tree.toJSON()\n```\n\nReturns **any** export data as JSON object\n\n### fromJSON\n\n[fromJSON](https://github.com/mourner/rbush#export-and-import)\n\n**Parameters**\n\n-   `json` **any** import previously exported data\n\n**Examples**\n\n```javascript\nvar exported = {\n  \"children\": [\n    {\n      \"type\": \"Feature\",\n      \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [110, 50]\n      },\n      \"properties\": {},\n      \"bbox\": [110, 50, 110, 50]\n    }\n  ],\n  \"height\": 1,\n  \"leaf\": true,\n  \"minX\": 110,\n  \"minY\": 50,\n  \"maxX\": 110,\n  \"maxY\": 50\n}\ntree.fromJSON(exported)\n```\n\nReturns **RBush** GeoJSON RBush\n","publish_time":1518624152446,"_cnpm_publish_time":1518624152446,"dist-tags":{"latest":"3.2.0"}}