@turf/boolean-intersects 7.1.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.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Boolean-intersects returns (TRUE) if the intersection of the two geometries is N
12
12
  * `feature2` **([Geometry][1] | [Feature][2]\<any>)** GeoJSON Feature or Geometry
13
13
  * `options` **[Object][3]** Optional parameters (optional, default `{}`)
14
14
 
15
- * `options.ignoreSelfIntersections` **[boolean][4]** ignores self-intersections on input features (optional, default `false`)
15
+ * `options.ignoreSelfIntersections` **[boolean][4]** ignore self-intersections on input features (optional, default `true`)
16
16
 
17
17
  ### Examples
18
18
 
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
2
2
  var _booleandisjoint = require('@turf/boolean-disjoint');
3
3
  var _meta = require('@turf/meta');
4
- function booleanIntersects(feature1, feature2, options = {}) {
5
- var _a;
6
- const ignoreSelfIntersections = (_a = options.ignoreSelfIntersections) != null ? _a : false;
4
+ function booleanIntersects(feature1, feature2, {
5
+ ignoreSelfIntersections = true
6
+ } = {}) {
7
7
  let bool = false;
8
8
  _meta.flattenEach.call(void 0, feature1, (flatten1) => {
9
9
  _meta.flattenEach.call(void 0, feature2, (flatten2) => {
@@ -17,9 +17,9 @@ function booleanIntersects(feature1, feature2, options = {}) {
17
17
  });
18
18
  return bool;
19
19
  }
20
- var turf_boolean_intersects_default = booleanIntersects;
20
+ var index_default = booleanIntersects;
21
21
 
22
22
 
23
23
 
24
- exports.booleanIntersects = booleanIntersects; exports.default = turf_boolean_intersects_default;
24
+ exports.booleanIntersects = booleanIntersects; exports.default = index_default;
25
25
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AACA,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AA2B5B,SAAS,kBACP,UACA,UACA,UAEI,CAAC,GACL;AAnCF;AAoCE,QAAM,2BACJ,aAAQ,4BAAR,YAAmC;AAErC,MAAI,OAAO;AACX,cAAY,UAAU,CAAC,aAAa;AAClC,gBAAY,UAAU,CAAC,aAAa;AAClC,UAAI,SAAS,MAAM;AACjB,eAAO;AAAA,MACT;AACA,aAAO,CAAC,gBAAgB,SAAS,UAAU,SAAS,UAAU;AAAA,QAC5D;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAGA,IAAO,kCAAQ","sourcesContent":["import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {boolean} true if geometries intersect, false otherwise\n * @example\n * var point1 = turf.point([2, 2]);\n * var point2 = turf.point([1, 2]);\n * var line = turf.lineString([[1, 1], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point1);\n * //=false\n *\n * turf.booleanIntersects(line, point2);\n * //=true\n *\n * //addToMap\n * var addToMap = [point1, point2, line];\n * point1.properties['marker-color'] = '#f00'\n * point2.properties['marker-color'] = '#0f0'\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry,\n options: {\n ignoreSelfIntersections?: boolean;\n } = {}\n) {\n const ignoreSelfIntersections: boolean =\n options.ignoreSelfIntersections ?? false;\n\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry, {\n ignoreSelfIntersections,\n });\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-boolean-intersects/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,yDAAgC;AAChC,kCAA4B;AA2B5B,SAAS,iBAAA,CACP,QAAA,EACA,QAAA,EACA;AAAA,EACE,wBAAA,EAA0B;AAC5B,EAAA,EAEI,CAAC,CAAA,EACL;AACA,EAAA,IAAI,KAAA,EAAO,KAAA;AACX,EAAA,+BAAA,QAAY,EAAU,CAAC,QAAA,EAAA,GAAa;AAClC,IAAA,+BAAA,QAAY,EAAU,CAAC,QAAA,EAAA,GAAa;AAClC,MAAA,GAAA,CAAI,KAAA,IAAS,IAAA,EAAM;AACjB,QAAA,OAAO,IAAA;AAAA,MACT;AACA,MAAA,KAAA,EAAO,CAAC,8CAAA,QAAgB,CAAS,QAAA,EAAU,QAAA,CAAS,QAAA,EAAU;AAAA,QAC5D;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACD,EAAA,OAAO,IAAA;AACT;AAGA,IAAO,cAAA,EAAQ,iBAAA;ADjCf;AACE;AACA;AACF,+EAAC","file":"/home/runner/work/turf/turf/packages/turf-boolean-intersects/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.\n *\n * @function\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreSelfIntersections=true] ignore self-intersections on input features\n * @returns {boolean} true if geometries intersect, false otherwise\n * @example\n * var point1 = turf.point([2, 2]);\n * var point2 = turf.point([1, 2]);\n * var line = turf.lineString([[1, 1], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point1);\n * //=false\n *\n * turf.booleanIntersects(line, point2);\n * //=true\n *\n * //addToMap\n * var addToMap = [point1, point2, line];\n * point1.properties['marker-color'] = '#f00'\n * point2.properties['marker-color'] = '#0f0'\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry,\n {\n ignoreSelfIntersections = true,\n }: {\n ignoreSelfIntersections?: boolean;\n } = {}\n) {\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry, {\n ignoreSelfIntersections,\n });\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"]}
@@ -3,11 +3,11 @@ import { Feature, Geometry } from 'geojson';
3
3
  /**
4
4
  * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.
5
5
  *
6
- * @name booleanIntersects
6
+ * @function
7
7
  * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
8
8
  * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
9
9
  * @param {Object} [options={}] Optional parameters
10
- * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features
10
+ * @param {boolean} [options.ignoreSelfIntersections=true] ignore self-intersections on input features
11
11
  * @returns {boolean} true if geometries intersect, false otherwise
12
12
  * @example
13
13
  * var point1 = turf.point([2, 2]);
@@ -25,7 +25,7 @@ import { Feature, Geometry } from 'geojson';
25
25
  * point1.properties['marker-color'] = '#f00'
26
26
  * point2.properties['marker-color'] = '#0f0'
27
27
  */
28
- declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry, options?: {
28
+ declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry, { ignoreSelfIntersections, }?: {
29
29
  ignoreSelfIntersections?: boolean;
30
30
  }): boolean;
31
31
 
@@ -3,11 +3,11 @@ import { Feature, Geometry } from 'geojson';
3
3
  /**
4
4
  * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.
5
5
  *
6
- * @name booleanIntersects
6
+ * @function
7
7
  * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
8
8
  * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
9
9
  * @param {Object} [options={}] Optional parameters
10
- * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features
10
+ * @param {boolean} [options.ignoreSelfIntersections=true] ignore self-intersections on input features
11
11
  * @returns {boolean} true if geometries intersect, false otherwise
12
12
  * @example
13
13
  * var point1 = turf.point([2, 2]);
@@ -25,7 +25,7 @@ import { Feature, Geometry } from 'geojson';
25
25
  * point1.properties['marker-color'] = '#f00'
26
26
  * point2.properties['marker-color'] = '#0f0'
27
27
  */
28
- declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry, options?: {
28
+ declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry, { ignoreSelfIntersections, }?: {
29
29
  ignoreSelfIntersections?: boolean;
30
30
  }): boolean;
31
31
 
package/dist/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // index.ts
2
2
  import { booleanDisjoint } from "@turf/boolean-disjoint";
3
3
  import { flattenEach } from "@turf/meta";
4
- function booleanIntersects(feature1, feature2, options = {}) {
5
- var _a;
6
- const ignoreSelfIntersections = (_a = options.ignoreSelfIntersections) != null ? _a : false;
4
+ function booleanIntersects(feature1, feature2, {
5
+ ignoreSelfIntersections = true
6
+ } = {}) {
7
7
  let bool = false;
8
8
  flattenEach(feature1, (flatten1) => {
9
9
  flattenEach(feature2, (flatten2) => {
@@ -17,9 +17,9 @@ function booleanIntersects(feature1, feature2, options = {}) {
17
17
  });
18
18
  return bool;
19
19
  }
20
- var turf_boolean_intersects_default = booleanIntersects;
20
+ var index_default = booleanIntersects;
21
21
  export {
22
22
  booleanIntersects,
23
- turf_boolean_intersects_default as default
23
+ index_default as default
24
24
  };
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {boolean} true if geometries intersect, false otherwise\n * @example\n * var point1 = turf.point([2, 2]);\n * var point2 = turf.point([1, 2]);\n * var line = turf.lineString([[1, 1], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point1);\n * //=false\n *\n * turf.booleanIntersects(line, point2);\n * //=true\n *\n * //addToMap\n * var addToMap = [point1, point2, line];\n * point1.properties['marker-color'] = '#f00'\n * point2.properties['marker-color'] = '#0f0'\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry,\n options: {\n ignoreSelfIntersections?: boolean;\n } = {}\n) {\n const ignoreSelfIntersections: boolean =\n options.ignoreSelfIntersections ?? false;\n\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry, {\n ignoreSelfIntersections,\n });\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"],"mappings":";AACA,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AA2B5B,SAAS,kBACP,UACA,UACA,UAEI,CAAC,GACL;AAnCF;AAoCE,QAAM,2BACJ,aAAQ,4BAAR,YAAmC;AAErC,MAAI,OAAO;AACX,cAAY,UAAU,CAAC,aAAa;AAClC,gBAAY,UAAU,CAAC,aAAa;AAClC,UAAI,SAAS,MAAM;AACjB,eAAO;AAAA,MACT;AACA,aAAO,CAAC,gBAAgB,SAAS,UAAU,SAAS,UAAU;AAAA,QAC5D;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAGA,IAAO,kCAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.\n *\n * @function\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreSelfIntersections=true] ignore self-intersections on input features\n * @returns {boolean} true if geometries intersect, false otherwise\n * @example\n * var point1 = turf.point([2, 2]);\n * var point2 = turf.point([1, 2]);\n * var line = turf.lineString([[1, 1], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point1);\n * //=false\n *\n * turf.booleanIntersects(line, point2);\n * //=true\n *\n * //addToMap\n * var addToMap = [point1, point2, line];\n * point1.properties['marker-color'] = '#f00'\n * point2.properties['marker-color'] = '#0f0'\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry,\n {\n ignoreSelfIntersections = true,\n }: {\n ignoreSelfIntersections?: boolean;\n } = {}\n) {\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry, {\n ignoreSelfIntersections,\n });\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"],"mappings":";AACA,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AA2B5B,SAAS,kBACP,UACA,UACA;AAAA,EACE,0BAA0B;AAC5B,IAEI,CAAC,GACL;AACA,MAAI,OAAO;AACX,cAAY,UAAU,CAAC,aAAa;AAClC,gBAAY,UAAU,CAAC,aAAa;AAClC,UAAI,SAAS,MAAM;AACjB,eAAO;AAAA,MACT;AACA,aAAO,CAAC,gBAAgB,SAAS,UAAU,SAAS,UAAU;AAAA,QAC5D;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAGA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/boolean-intersects",
3
- "version": "7.1.0",
4
- "description": "turf boolean-intersects module",
3
+ "version": "7.3.0",
4
+ "description": "Checks if two geometries overlap in any way.",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Rowan Winsemius <@rowanwins>",
@@ -57,22 +57,22 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/benchmark": "^2.1.5",
60
- "@types/tape": "^4.2.32",
60
+ "@types/tape": "^5.8.1",
61
61
  "benchmark": "^2.1.4",
62
62
  "boolean-shapely": "*",
63
63
  "load-json-file": "^7.0.1",
64
64
  "npm-run-all": "^4.1.5",
65
- "tape": "^5.7.2",
66
- "tsup": "^8.0.1",
67
- "tsx": "^4.6.2",
68
- "typescript": "^5.2.2"
65
+ "tape": "^5.9.0",
66
+ "tsup": "^8.4.0",
67
+ "tsx": "^4.19.4",
68
+ "typescript": "^5.8.3"
69
69
  },
70
70
  "dependencies": {
71
- "@turf/boolean-disjoint": "^7.1.0",
72
- "@turf/helpers": "^7.1.0",
73
- "@turf/meta": "^7.1.0",
71
+ "@turf/boolean-disjoint": "7.3.0",
72
+ "@turf/helpers": "7.3.0",
73
+ "@turf/meta": "7.3.0",
74
74
  "@types/geojson": "^7946.0.10",
75
- "tslib": "^2.6.2"
75
+ "tslib": "^2.8.1"
76
76
  },
77
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
77
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
78
78
  }