{"name":"geojson-rbush","version":"2.0.1","description":"GeoJSON implementation of RBush","main":"main.js","module":"index.js","jsnext:main":"index.js","types":"index.d.ts","files":["index.js","index.d.ts","main.js","quickselect.js","rbush.js"],"scripts":{"prepublish":"rollup -c rollup.config.js","pretest":"eslint index.js","test":"tap test.js","bench":"node bench.js","docs":"documentation readme index.js --shallow --section=API --markdown-toc"},"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":{"@types/geojson":"*","@types/rbush":"*","benchmark":"*","documentation":"*","eslint":"*","eslint-config-mourner":"*","load-json-file":"*","tap":"*","write-json-file":"*"},"dependencies":{"@turf/meta":"*"},"gitHead":"20d13ad7e3d14e3b88bda6af254c03b3ede55cf8","_id":"geojson-rbush@2.0.1","_shasum":"3b211decf02a6e2c21fb8c3de59b4de5b61679d9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.2","_npmUser":{"name":"deniscarriere","email":"carriere.denis@gmail.com"},"dist":{"shasum":"3b211decf02a6e2c21fb8c3de59b4de5b61679d9","tarball":"http://registry-npm.ywwl.com/geojson-rbush/download/geojson-rbush-2.0.1.tgz","integrity":"sha512-8mFJ31QRMnuia9UitVorzltcfiS0SdXzZssNcK/yt6RH8ZRI6j2LdACK2wuAK21+Jw5vf7OsRz3wKQYf+mrLhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN7FjEDVgyJOM6DHYLw0YnYRHtoGDzV3O62Pncp/USqAIhAMkY5RgRz+Aba4D23/9PBhVgYpWMDTeWiXnma1f0r4A/"}],"size":10200,"noattachment":false,"key":"/geojson-rbush/-/geojson-rbush-2.0.1.tgz"},"maintainers":[{"name":"deniscarriere","email":"carriere.denis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-rbush-2.0.1.tgz_1506910730840_0.9807752536144108"},"directories":{},"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":1506910730946,"_cnpm_publish_time":1506910730946,"dist-tags":{"latest":"3.2.0"}}