@turf/boolean-intersects 7.2.0 → 7.3.1

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
 
@@ -17,9 +17,9 @@ function booleanIntersects(feature1, feature2, {
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":["/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,gCAAA,EAAQ,iBAAA;ADjCf;AACE;AACA;AACF,iGAAC","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"]}
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"]}
package/dist/esm/index.js CHANGED
@@ -17,9 +17,9 @@ function booleanIntersects(feature1, feature2, {
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 * @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,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.2.0",
4
- "description": "turf boolean-intersects module",
3
+ "version": "7.3.1",
4
+ "description": "Checks if two geometries overlap in any way.",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Rowan Winsemius <@rowanwins>",
@@ -52,27 +52,26 @@
52
52
  "bench": "tsx bench.ts",
53
53
  "build": "tsup --config ../../tsup.config.ts",
54
54
  "docs": "tsx ../../scripts/generate-readmes.ts",
55
- "test": "npm-run-all --npm-path npm test:*",
55
+ "test": "pnpm run /test:.*/",
56
56
  "test:tape": "tsx test.ts"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/benchmark": "^2.1.5",
60
- "@types/tape": "^4.13.4",
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
- "npm-run-all": "^4.1.5",
65
64
  "tape": "^5.9.0",
66
- "tsup": "^8.3.5",
67
- "tsx": "^4.19.2",
68
- "typescript": "^5.5.4"
65
+ "tsup": "^8.4.0",
66
+ "tsx": "^4.19.4",
67
+ "typescript": "^5.8.3"
69
68
  },
70
69
  "dependencies": {
71
- "@turf/boolean-disjoint": "^7.2.0",
72
- "@turf/helpers": "^7.2.0",
73
- "@turf/meta": "^7.2.0",
70
+ "@turf/boolean-disjoint": "7.3.1",
71
+ "@turf/helpers": "7.3.1",
72
+ "@turf/meta": "7.3.1",
74
73
  "@types/geojson": "^7946.0.10",
75
74
  "tslib": "^2.8.1"
76
75
  },
77
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
76
+ "gitHead": "b7f1b4eafb760431e03955499d8eac9489438219"
78
77
  }