@turf/geojson-rbush 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,9 +70,9 @@ function geojsonRbush(maxEntries) {
70
70
  };
71
71
  return tree;
72
72
  }
73
- var turf_geojson_rbush_default = geojsonRbush;
73
+ var index_default = geojsonRbush;
74
74
 
75
75
 
76
76
 
77
- exports.default = turf_geojson_rbush_default; exports.geojsonRbush = geojsonRbush;
77
+ exports.default = index_default; exports.geojsonRbush = geojsonRbush;
78
78
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-geojson-rbush/dist/cjs/index.cjs","../../index.js"],"names":[],"mappings":"AAAA;ACAA,4EAAkB;AAClB,wCAAkC;AAClC,kCAA4B;AAC5B,kCAAiC;AAiBjC,SAAS,YAAA,CAAa,UAAA,EAAY;AAChC,EAAA,IAAI,KAAA,EAAO,IAAI,oBAAA,CAAM,UAAU,CAAA;AAY/B,EAAA,IAAA,CAAK,OAAA,EAAS,QAAA,CAAU,OAAA,EAAS;AAC/B,IAAA,GAAA,CAAI,OAAA,CAAQ,KAAA,IAAS,SAAA,EAAW,MAAM,IAAI,KAAA,CAAM,iBAAiB,CAAA;AACjE,IAAA,OAAA,CAAQ,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,wBAAA,OAAgB,CAAA;AAC7D,IAAA,OAAO,eAAA,CAAM,SAAA,CAAU,MAAA,CAAO,IAAA,CAAK,IAAA,EAAM,OAAO,CAAA;AAAA,EAClD,CAAA;AAeA,EAAA,IAAA,CAAK,KAAA,EAAO,QAAA,CAAU,QAAA,EAAU;AAC9B,IAAA,IAAI,KAAA,EAAO,CAAC,CAAA;AAEZ,IAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAC3B,MAAA,QAAA,CAAS,OAAA,CAAQ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AA,CAAQ,IAAA;AAAA,IAAA,KAAA,GAAA,CACxB,KAAA,CAAM,OAAA,CAAQ,OAAO,EAAA,GAAK,OAAA,CAAQ,OAAA,IAAW,CAAA,EAAG,KAAA,EAAO,OAAA;AAAA,IAAA,KAAA,GAAA,CACvD,KAAA,CAAM,OAAA,CAAQ,OAAO,EAAA,GAAK,OAAA,CAAQ,OAAA,IAAW,CAAA;AACpD,MAAA,KAAA,EAAO,CAAC,OAAA,CAAQ,CAAC,CAAA,EAAG,OAAA,CAAQ,CAAC,CAAA,EAAG,OAAA,CAAQ,CAAC,CAAA,EAAG,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA,IAAA,KAAA,GAAA,CAC/C,OAAA,CAAQ,KAAA,IAAS,SAAA,EAAW,KAAA,EAAO,wBAAA,OAAgB,CAAA;AAAA,IAAA,KAAA,GAAA,CACnD,OAAA,CAAQ,KAAA,IAAS,mBAAA,EAAqB,KAAA,EAAO,wBAAA,OAAgB,CAAA;AAAA,IAAA,KACjE,MAAM,IAAI,KAAA,CAAM,iBAAiB,CAAA;AAEtC,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC;AAAA,IACd,CAAA;AAAA,EACF,CAAA;AACA,EAAA,OAAO,IAAA;AACT;AAGA,IAAO,2BAAA,EAAQ,YAAA;ADlJf;AACE;AACA;AACF,kFAAC","file":"/home/runner/work/turf/turf/packages/turf-geojson-rbush/dist/cjs/index.cjs","sourcesContent":[null,"import rbush from \"rbush\";\nimport { featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\n\n/**\n * @module rbush\n */\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @function rbush\n * @param {number} [maxEntries=9] 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.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = new rbush(maxEntries);\n\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @memberof rbush\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @memberof rbush\n * @param {FeatureCollection|Array<Feature>} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @memberof rbush\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6)\n bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === \"Feature\") bbox = turfBBox(geojson);\n else if (geojson.type === \"FeatureCollection\") bbox = turfBBox(geojson);\n else throw new Error(\"invalid geojson\");\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n };\n };\n return tree;\n}\n\nexport { geojsonRbush };\nexport default geojsonRbush;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-geojson-rbush/dist/cjs/index.cjs","../../index.js"],"names":[],"mappings":"AAAA;ACAA,4EAAkB;AAClB,wCAAkC;AAClC,kCAA4B;AAC5B,kCAAiC;AAiBjC,SAAS,YAAA,CAAa,UAAA,EAAY;AAChC,EAAA,IAA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AAgB,CAAA;AAAA,IAAA,KACjE,MAAM,IAAI,KAAA,CAAM,iBAAiB,CAAA;AAEtC,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC,CAAA;AAAA,MACZ,IAAA,EAAM,IAAA,CAAK,CAAC;AAAA,IACd,CAAA;AAAA,EACF,CAAA;AACA,EAAA,OAAO,IAAA;AACT;AAGA,IAAO,cAAA,EAAQ,YAAA;ADlJf;AACE;AACA;AACF,qEAAC","file":"/home/runner/work/turf/turf/packages/turf-geojson-rbush/dist/cjs/index.cjs","sourcesContent":[null,"import rbush from \"rbush\";\nimport { featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\n\n/**\n * @module rbush\n */\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @function rbush\n * @param {number} [maxEntries=9] 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.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = new rbush(maxEntries);\n\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @memberof rbush\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @memberof rbush\n * @param {FeatureCollection|Array<Feature>} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @memberof rbush\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6)\n bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === \"Feature\") bbox = turfBBox(geojson);\n else if (geojson.type === \"FeatureCollection\") bbox = turfBBox(geojson);\n else throw new Error(\"invalid geojson\");\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n };\n };\n return tree;\n}\n\nexport { geojsonRbush };\nexport default geojsonRbush;\n"]}
package/dist/esm/index.js CHANGED
@@ -70,9 +70,9 @@ function geojsonRbush(maxEntries) {
70
70
  };
71
71
  return tree;
72
72
  }
73
- var turf_geojson_rbush_default = geojsonRbush;
73
+ var index_default = geojsonRbush;
74
74
  export {
75
- turf_geojson_rbush_default as default,
75
+ index_default as default,
76
76
  geojsonRbush
77
77
  };
78
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.js"],"sourcesContent":["import rbush from \"rbush\";\nimport { featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\n\n/**\n * @module rbush\n */\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @function rbush\n * @param {number} [maxEntries=9] 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.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = new rbush(maxEntries);\n\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @memberof rbush\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @memberof rbush\n * @param {FeatureCollection|Array<Feature>} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @memberof rbush\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6)\n bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === \"Feature\") bbox = turfBBox(geojson);\n else if (geojson.type === \"FeatureCollection\") bbox = turfBBox(geojson);\n else throw new Error(\"invalid geojson\");\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n };\n };\n return tree;\n}\n\nexport { geojsonRbush };\nexport default geojsonRbush;\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,gBAAgB;AAiBjC,SAAS,aAAa,YAAY;AAChC,MAAI,OAAO,IAAI,MAAM,UAAU;AAY/B,OAAK,SAAS,SAAU,SAAS;AAC/B,QAAI,QAAQ,SAAS,UAAW,OAAM,IAAI,MAAM,iBAAiB;AACjE,YAAQ,OAAO,QAAQ,OAAO,QAAQ,OAAO,SAAS,OAAO;AAC7D,WAAO,MAAM,UAAU,OAAO,KAAK,MAAM,OAAO;AAAA,EAClD;AAeA,OAAK,OAAO,SAAU,UAAU;AAC9B,QAAI,OAAO,CAAC;AAEZ,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,eAAS,QAAQ,SAAU,SAAS;AAClC,YAAI,QAAQ,SAAS,UAAW,OAAM,IAAI,MAAM,kBAAkB;AA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,SAAU,SAAS;AAC/B,QAAI;AACJ,QAAI,QAAQ,KAAM,QAAO,QAAQ;AAAA,aACxB,MAAM,QAAQ,OAAO,KAAK,QAAQ,WAAW,EAAG,QAAO;AAAA,aACvD,MAAM,QAAQ,OAAO,KAAK,QAAQ,WAAW;AACpD,aAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;AAAA,aAC/C,QAAQ,SAAS,UAAW,QAAO,SAAS,OAAO;AAAA,aACnD,QAAQ,SAAS,oBAAqB,QAAO,SAAS,OAAO;AAAA,QACjE,OAAM,IAAI,MAAM,iBAAiB;AAEtC,WAAO;AAAA,MACL,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,IACd;AAAA,EACF;AACA,SAAO;AACT;AAGA,IAAO,6BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.js"],"sourcesContent":["import rbush from \"rbush\";\nimport { featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\n\n/**\n * @module rbush\n */\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @function rbush\n * @param {number} [maxEntries=9] 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.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = new rbush(maxEntries);\n\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @memberof rbush\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @memberof rbush\n * @param {FeatureCollection|Array<Feature>} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid features\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== \"Feature\") throw new Error(\"invalid feature\");\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @memberof rbush\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @memberof rbush\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @memberof rbush\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @memberof rbush\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var 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 * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @memberof rbush\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6)\n bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === \"Feature\") bbox = turfBBox(geojson);\n else if (geojson.type === \"FeatureCollection\") bbox = turfBBox(geojson);\n else throw new Error(\"invalid geojson\");\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n };\n };\n return tree;\n}\n\nexport { geojsonRbush };\nexport default geojsonRbush;\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,gBAAgB;AAiBjC,SAAS,aAAa,YAAY;AAChC,MAAI,OAAO,IAAI,MAAM,UAAU;AAY/B,OAAK,SAAS,SAAU,SAAS;AAC/B,QAAI,QAAQ,SAAS,UAAW,OAAM,IAAI,MAAM,iBAAiB;AACjE,YAAQ,OAAO,QAAQ,OAAO,QAAQ,OAAO,SAAS,OAAO;AAC7D,WAAO,MAAM,UAAU,OAAO,KAAK,MAAM,OAAO;AAAA,EAClD;AAeA,OAAK,OAAO,SAAU,UAAU;AAC9B,QAAI,OAAO,CAAC;AAEZ,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,eAAS,QAAQ,SAAU,SAAS;AAClC,YAAI,QAAQ,SAAS,UAAW,OAAM,IAAI,MAAM,kBAAkB;AAClE,gBAAQ,OAAO,QAAQ,OAAO,QAAQ,OAAO,SAAS,OAAO;AAC7D,a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AAAA,aACxB,MAAM,QAAQ,OAAO,KAAK,QAAQ,WAAW,EAAG,QAAO;AAAA,aACvD,MAAM,QAAQ,OAAO,KAAK,QAAQ,WAAW;AACpD,aAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;AAAA,aAC/C,QAAQ,SAAS,UAAW,QAAO,SAAS,OAAO;AAAA,aACnD,QAAQ,SAAS,oBAAqB,QAAO,SAAS,OAAO;AAAA,QACjE,OAAM,IAAI,MAAM,iBAAiB;AAEtC,WAAO;AAAA,MACL,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,IACd;AAAA,EACF;AACA,SAAO;AACT;AAGA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/geojson-rbush",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "GeoJSON implementation of RBush",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -58,25 +58,25 @@
58
58
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
59
59
  },
60
60
  "devDependencies": {
61
- "@turf/bbox-polygon": "^7.2.0",
62
- "@turf/random": "^7.2.0",
61
+ "@turf/bbox-polygon": "7.3.0",
62
+ "@turf/random": "7.3.0",
63
63
  "@types/benchmark": "^2.1.5",
64
- "@types/tape": "^4.13.4",
64
+ "@types/tape": "^5.8.1",
65
65
  "benchmark": "^2.1.4",
66
66
  "load-json-file": "^7.0.1",
67
67
  "npm-run-all": "^4.1.5",
68
68
  "tape": "^5.9.0",
69
- "tsup": "^8.3.5",
70
- "tsx": "^4.19.2",
71
- "typescript": "^5.2.2",
72
- "write-json-file": "^5.0.0"
69
+ "tsup": "^8.4.0",
70
+ "tsx": "^4.19.4",
71
+ "typescript": "^5.8.3",
72
+ "write-json-file": "^6.0.0"
73
73
  },
74
74
  "dependencies": {
75
- "@turf/bbox": "^7.2.0",
76
- "@turf/helpers": "^7.2.0",
77
- "@turf/meta": "^7.2.0",
75
+ "@turf/bbox": "7.3.0",
76
+ "@turf/helpers": "7.3.0",
77
+ "@turf/meta": "7.3.0",
78
78
  "@types/geojson": "^7946.0.10",
79
79
  "rbush": "^3.0.1"
80
80
  },
81
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
81
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
82
82
  }