{"name":"geojson-rbush","version":"1.2.0","description":"GeoJSON implementation of RBush","main":"index.js","types":"index.d.ts","files":["index.js","index.d.ts"],"scripts":{"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":"^1.0.0","@types/rbush":"^2.0.2","benchmark":"^2.1.3","documentation":"^4.0.0-beta.18","eslint":"^3.18.0","eslint-config-mourner":"^2.0.1","load-json-file":"^2.0.0","tap":"^10.3.2","write-json-file":"^2.0.0"},"dependencies":{"@turf/meta":"^4.6.0","rbush":"^2.0.1"},"gitHead":"98dd4ae279efb9bdafc60e597537ab73e713d68e","_id":"geojson-rbush@1.2.0","_shasum":"eca3b6a3afb899a453ef82d5e2373092e20d77e5","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"deniscarriere","email":"carriere.denis@gmail.com"},"dist":{"shasum":"eca3b6a3afb899a453ef82d5e2373092e20d77e5","tarball":"http://registry-npm.ywwl.com/geojson-rbush/download/geojson-rbush-1.2.0.tgz","integrity":"sha512-iiMclCIFRNLuTNghpvKNd7K11D1esI21qJGuptk3w8frT8cgjtjBiCrQHL0aAhrOOUq8atbXuvY/dhtA3+tJdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+IyKrZFntKoAvkuxoPR2k7bqlqce8OwS/ouxVoS4nvgIgfobCk2+cjgWE4Dt44Uvg4eSn6YNidb1KJb2yD4pg/B4="}],"size":4808,"noattachment":false,"key":"/geojson-rbush/-/geojson-rbush-1.2.0.tgz"},"maintainers":[{"name":"deniscarriere","email":"carriere.denis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-rbush-1.2.0.tgz_1503502073699_0.4097661494743079"},"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":1503502073866,"_cnpm_publish_time":1503502073866,"dist-tags":{"latest":"3.2.0"}}