{"name":"@turf/geojson-rbush","version":"7.1.0","description":"GeoJSON implementation of RBush","author":"Turf Authors","contributors":["Vladimir Agafonkin <@mourner>","Denis Carriere <@DenisCarriere>","Jordan Rousseau <@jvrousseau>"],"license":"MIT","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"homepage":"https://github.com/Turfjs/turf","repository":{"type":"git","url":"git://github.com/Turfjs/turf.git"},"funding":"https://opencollective.com/turf","publishConfig":{"access":"public"},"keywords":["geojson","index","tree","spatial","rbush"],"type":"module","main":"dist/cjs/index.cjs","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"}}},"sideEffects":false,"scripts":{"bench":"tsx bench.ts","build":"tsup --config ../../tsup.config.ts","docs":"tsx ../../scripts/generate-readmes.ts","test":"npm-run-all --npm-path npm test:*","test:tape":"tsx test.ts","test:types":"tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"},"devDependencies":{"@turf/bbox-polygon":"^7.1.0","@turf/random":"^7.1.0","@types/benchmark":"^2.1.5","@types/tape":"^4.2.32","benchmark":"^2.1.4","load-json-file":"^7.0.1","npm-run-all":"^4.1.5","tape":"^5.7.2","tsup":"^8.0.1","tsx":"^4.6.2","typescript":"^5.2.2","write-json-file":"^5.0.0"},"dependencies":{"@turf/bbox":"^7.1.0","@turf/helpers":"^7.1.0","@turf/meta":"^7.1.0","@types/geojson":"^7946.0.10","rbush":"^3.0.1"},"gitHead":"68915eeebc9278bb40dec3f1034499698a0561ef","_nodeVersion":"18.20.4","_npmVersion":"lerna/8.1.7/node@v18.20.4+x64 (linux)","_id":"@turf/geojson-rbush@7.1.0","dist":{"integrity":"sha512-j1C7Ohlxa1z644bNOpgibcFGaDLgLXGLOzwF1tfQaP5y7E4PJQUXL0DWIgNb3Ke7gZC05LPHM25a5TRReUfFBQ==","shasum":"7a7efcb64965b989ced1e7f5b849a0d46852c79f","tarball":"http://registry-npm.ywwl.com/@turf/geojson-rbush/download/@turf/geojson-rbush-7.1.0.tgz","fileCount":9,"unpackedSize":36668,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPoZLJx1/+n/GAor663p950zXCXu20lKAnl7890nfHtwIhANB8Dzc53Xow1OOLK2HfleoCQwhP5jneiW8A/DfmeRL2"}],"size":6592,"noattachment":false,"key":"/@turf/geojson-rbush/-/@turf/geojson-rbush-7.1.0.tgz"},"_npmUser":{"name":"mdfedderly","email":"mdfedderly@mdfedderly.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-rbush_7.1.0_1723227887496_0.15153055687569905"},"_hasShrinkwrap":false,"readme":"# @turf/geojson-rbush\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## rbush\n\n### insert\n\n[insert][1]\n\n#### Parameters\n\n*   `feature` **[Feature][2]** 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][3]\n\n#### Parameters\n\n*   `features` **([FeatureCollection][4] | [Array][5]<[Feature][2]>)** 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][6]\n\n#### Parameters\n\n*   `feature` **[Feature][2]** remove single GeoJSON Feature\n*   `equals` **[Function][7]** 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][6]\n\n#### Examples\n\n```javascript\ntree.clear()\n```\n\nReturns **RBush** GeoJSON Rbush\n\n### search\n\n[search][8]\n\n#### Parameters\n\n*   `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** 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][4]** all features that intersects with the given GeoJSON.\n\n### collides\n\n[collides][10]\n\n#### Parameters\n\n*   `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** 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][11]** true if there are any items intersecting the given GeoJSON, otherwise false.\n\n### all\n\n[all][8]\n\n#### Examples\n\n```javascript\ntree.all()\n```\n\nReturns **[FeatureCollection][4]** all the features in RBush\n\n### toJSON\n\n[toJSON][12]\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][12]\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\n## rbush\n\nGeoJSON implementation of [RBush][13] spatial index.\n\n### Parameters\n\n*   `maxEntries` **[number][14]** 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][1]\n\n#### Parameters\n\n*   `feature` **[Feature][2]** 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][3]\n\n#### Parameters\n\n*   `features` **([FeatureCollection][4] | [Array][5]<[Feature][2]>)** 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][6]\n\n#### Parameters\n\n*   `feature` **[Feature][2]** remove single GeoJSON Feature\n*   `equals` **[Function][7]** 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][6]\n\n#### Examples\n\n```javascript\ntree.clear()\n```\n\nReturns **RBush** GeoJSON Rbush\n\n### search\n\n[search][8]\n\n#### Parameters\n\n*   `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** 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][4]** all features that intersects with the given GeoJSON.\n\n### collides\n\n[collides][10]\n\n#### Parameters\n\n*   `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** 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][11]** true if there are any items intersecting the given GeoJSON, otherwise false.\n\n### all\n\n[all][8]\n\n#### Examples\n\n```javascript\ntree.all()\n```\n\nReturns **[FeatureCollection][4]** all the features in RBush\n\n### toJSON\n\n[toJSON][12]\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][12]\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\n[1]: https://github.com/mourner/rbush#data-format\n\n[2]: https://tools.ietf.org/html/rfc7946#section-3.2\n\n[3]: https://github.com/mourner/rbush#bulk-inserting-data\n\n[4]: https://tools.ietf.org/html/rfc7946#section-3.3\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\n\n[6]: https://github.com/mourner/rbush#removing-data\n\n[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n\n[8]: https://github.com/mourner/rbush#search\n\n[9]: https://tools.ietf.org/html/rfc7946#section-5\n\n[10]: https://github.com/mourner/rbush#collisions\n\n[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n\n[12]: https://github.com/mourner/rbush#export-and-import\n\n[13]: https://github.com/mourner/rbush#rbush\n\n[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run \"yarn docs\" from the root of the turf project. -->\n\n---\n\nThis module is part of the [Turfjs project](https://turfjs.org/), an open source module collection dedicated to geographic algorithms. It is maintained in the [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create PRs and issues.\n\n### Installation\n\nInstall this single module individually:\n\n```sh\n$ npm install @turf/geojson-rbush\n```\n\nOr install the all-encompassing @turf/turf module that includes all modules as functions:\n\n```sh\n$ npm install @turf/turf\n```\n","publish_time":1723227887655,"maintainers":[{"name":"smallsaucepan","email":"james@smallsaucepan.com"},{"name":"morgan.herlocker","email":"morganherlocker@gmail.com"},{"name":"twelch","email":"tim.j.welch@gmail.com"},{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},{"name":"rowanwins","email":"rowanwins@yahoo.com.au"},{"name":"tmcw","email":"tom@macwright.com"},{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"tcql","email":"tim.channell@gmail.com"},{"name":"mdfedderly","email":"mdfedderly@mdfedderly.com"}],"_cnpm_publish_time":1723227887655,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}