{"name":"@turf/geojson-rbush","version":"3.2.0","keywords":["geojson","index","tree","spatial","rbush"],"author":{"name":"Denis Carriere","email":"@DenisCarriere"},"license":"MIT","_id":"@turf/geojson-rbush@3.2.0","contributors":[{"name":"Vladimir Agafonkin","email":"@mourner"},{"name":"Denis Carriere","email":"@DenisCarriere"},{"name":"Jordan Rousseau","email":"@jvrousseau"}],"dist":{"shasum":"325a86348e62364c685f8f1548e1ff6b4f0b339b","tarball":"http://registry-npm.ywwl.com/@turf/geojson-rbush/download/@turf/geojson-rbush-3.2.0.tgz","fileCount":6,"integrity":"sha512-1OGzZpjSiy7i/ZfFAV9859l1SdLpUshNyvTZCLbdSbDOrXc3ePsBeuJ4+MBDRbAF0p1ms6FdjAKcWT4nYjgWXg==","signatures":[{"sig":"MEYCIQD+F0MPeF0qv6PgXVYvxZOwSit7hxRD7yUyc7BWckEHAAIhANNoNogHsGFtCucGBzRGH5oDDkiHukmpzn6sqx9mPo0w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15892,"size":4665,"noattachment":false,"key":"/@turf/geojson-rbush/-/@turf/geojson-rbush-3.2.0.tgz"},"main":"index","types":"index.d.ts","gitHead":"5072ed28c515a4af1cb08ae055791b6a52a89638","scripts":{"docs":"documentation readme index.js --section=API","test":"node test.js --coverage","bench":"node bench.js","pretest":"tsc types.ts"},"_npmUser":{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},"_npmVersion":"6.14.14","description":"GeoJSON implementation of RBush","directories":{},"_nodeVersion":"14.16.0","dependencies":{"rbush":"^3.0.1","@turf/bbox":"*","@turf/meta":"6.x","@turf/helpers":"6.x","@types/geojson":"7946.0.8"},"_hasShrinkwrap":false,"devDependencies":{"tap":"*","tape":"*","benchmark":"*","typescript":"*","@types/node":"*","@turf/random":"*","documentation":"*","load-json-file":"*","write-json-file":"*","@turf/bbox-polygon":"*"},"_npmOperationalInternal":{"tmp":"tmp/geojson-rbush_3.2.0_1635021705952_0.7974937796291104","host":"s3://npm-registry-packages"},"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":1635021706073,"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":1635021706073,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}