{"name":"geojson-rbush","version":"3.2.0","description":"GeoJSON implementation of RBush","main":"index","types":"index.d.ts","scripts":{"pretest":"tsc types.ts","test":"node 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","@types/geojson":"7946.0.8","rbush":"^3.0.1"},"gitHead":"303cc81fd524ddcfca14ce2001453c51f85abc60","_id":"geojson-rbush@3.2.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==","shasum":"8b543cf0d56f99b78faf1da52bb66acad6dfc290","tarball":"http://registry-npm.ywwl.com/geojson-rbush/download/geojson-rbush-3.2.0.tgz","fileCount":5,"unpackedSize":14860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAtpQCRA9TVsSAnZWagAAR58P/2AIwXKBxiOHLB7jZrwd\n9ej9KJLX1HNoRYOEM+Om5FVcT0PePjDzyRBLCbansiVE5nEwPAH4A29PFxFN\nReowFjSBx8drbGHo6n53TAjELk0uwbCCwqppAF+LFBKZMpC8Ur55C1kxIkVa\nmusPkY0xdf4Xfu66FdPUJgYvd6hpKcL6DY2/jMES94et3dEOmhIhiiUn+qhp\nynFUmxhGke7KzisEH5urDOYWkOLSY5lOk9AI4HIeRA6G5Ux6EbJs0G7Yqb8g\nbwKePOFSd2YXmwZB7aYQoRhvmwibArdKJkmr2LTI1fr5I9KJAkev2aAvypj4\nFNckrghqdvi9czNQOMpNCtpLrTeFItufTzybYsr3PTgdN5dWqq2vIT6JlIE0\nwmKAzCFEy18Y6VXLJ+vevAPSPvm+KqP2RbP+3xfMszvSgf/JvcEGBPX9qP9t\nfFgvLUA6NQuaSU1khnjiXD2EidEe47woqNIJSAcC2nN7ZV++hhHPiN58Y0xe\nnGyRGowR6UQ+9DEvz69O0qwS9pM3U8Gxmnr9QDxD+eRDynPzpAda0nXlNjl9\ndijQymtgk4K3zF3hOlsfErXfWl2sz2kLlP0IXneS+moJqEulv0IGxguXBzWi\nFIrqpiepZru5T87Rx8u9uWGbfpxwOeL3L9D+S+iBw4DZpNHXuT2ZJdnKtPro\n1KNQ\r\n=OMc7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIApqmxhedwsUxd41CqGQY6CMzicysdfh9rhVaEMhnctmAiBMiQ7ry9f3HpAeYyoTTx742+CmBAHdNAzmMidNTsGmcQ=="}],"size":4107,"noattachment":false,"key":"/geojson-rbush/-/geojson-rbush-3.2.0.tgz"},"_npmUser":{"name":"deniscarriere","email":"carriere.denis@gmail.com"},"directories":{},"maintainers":[{"name":"deniscarriere","email":"carriere.denis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-rbush_3.2.0_1627576912787_0.47082122465951515"},"_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":1627576912960,"_cnpm_publish_time":1627576912960,"dist-tags":{"latest":"3.2.0"}}