{"name":"@turf/geojson-rbush","version":"7.3.0","keywords":["geojson","index","tree","spatial","rbush"],"author":"Turf Authors","license":"MIT","_id":"@turf/geojson-rbush@7.3.0","maintainers":[{"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"},{"name":"twelch","email":"tim.j.welch@gmail.com"},{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},{"name":"morgan.herlocker","email":"morganherlocker@gmail.com"},{"name":"smallsaucepan","email":"james@smallsaucepan.com"}],"contributors":["Vladimir Agafonkin <@mourner>","Denis Carriere <@DenisCarriere>","Jordan Rousseau <@jvrousseau>"],"homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"4d687e87701f63fbdca2399544aadb6243a15f92","tarball":"http://registry-npm.ywwl.com/@turf/geojson-rbush/download/@turf/geojson-rbush-7.3.0.tgz","fileCount":9,"integrity":"sha512-pej4q6pZGye/jYiQVehIHw2vcsSqubvGw93WBkuj8cZJm2OC7YAYzNpG5lcmdsr2HGR1Yrb1tCprVEUnsX92sQ==","signatures":[{"sig":"MEYCIQCbH5aHLoJ9312+6FjSxIizIligSoZwx2eSTH/O6vVwvwIhALux2G3YljuEvxaZ9me3TNcs7WTekhbmSr8ocR37pUzF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38182,"size":7210,"noattachment":false,"key":"/@turf/geojson-rbush/-/@turf/geojson-rbush-7.3.0.tgz"},"main":"dist/cjs/index.cjs","type":"module","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"}},"./package.json":"./package.json"},"funding":"https://opencollective.com/turf","gitHead":"9f58a103e8f9a587ab640307ed03ba5233913ddd","scripts":{"docs":"tsx ../../scripts/generate-readmes.ts","test":"npm-run-all --npm-path npm test:*","bench":"tsx bench.ts","build":"tsup --config ../../tsup.config.ts","test:tape":"tsx test.ts","test:types":"tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"},"_npmUser":{"name":"mdfedderly","email":"mdfedderly@mdfedderly.com"},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"lerna/8.2.2/node@v20.19.5+x64 (linux)","description":"GeoJSON implementation of RBush","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"rbush":"^3.0.1","@turf/bbox":"7.3.0","@turf/meta":"7.3.0","@turf/helpers":"7.3.0","@types/geojson":"^7946.0.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tape":"^5.9.0","tsup":"^8.4.0","benchmark":"^2.1.4","typescript":"^5.8.3","@types/tape":"^5.8.1","npm-run-all":"^4.1.5","@turf/random":"7.3.0","load-json-file":"^7.0.1","write-json-file":"^6.0.0","@types/benchmark":"^2.1.5","@turf/bbox-polygon":"7.3.0"},"_npmOperationalInternal":{"tmp":"tmp/geojson-rbush_7.3.0_1763371520392_0.3610473055758263","host":"s3://npm-registry-packages-npm-production"},"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":1763371520598,"_cnpm_publish_time":1763371520598,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}