@turf/boolean-intersects 7.1.0 → 7.2.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/dist/cjs/index.cjs +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +3 -3
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +11 -11
package/dist/cjs/index.cjs
CHANGED
|
@@ -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,
|
|
5
|
-
|
|
6
|
-
|
|
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) => {
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";
|
|
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"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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
|
-
* @
|
|
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=
|
|
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,
|
|
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.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
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=
|
|
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,
|
|
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,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
function booleanIntersects(feature1, feature2, {
|
|
5
|
+
ignoreSelfIntersections = true
|
|
6
|
+
} = {}) {
|
|
7
7
|
let bool = false;
|
|
8
8
|
flattenEach(feature1, (flatten1) => {
|
|
9
9
|
flattenEach(feature2, (flatten2) => {
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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 * @
|
|
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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/boolean-intersects",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf boolean-intersects module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -57,22 +57,22 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/benchmark": "^2.1.5",
|
|
60
|
-
"@types/tape": "^4.
|
|
60
|
+
"@types/tape": "^4.13.4",
|
|
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.
|
|
66
|
-
"tsup": "^8.
|
|
67
|
-
"tsx": "^4.
|
|
68
|
-
"typescript": "^5.
|
|
65
|
+
"tape": "^5.9.0",
|
|
66
|
+
"tsup": "^8.3.5",
|
|
67
|
+
"tsx": "^4.19.2",
|
|
68
|
+
"typescript": "^5.5.4"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@turf/boolean-disjoint": "^7.
|
|
72
|
-
"@turf/helpers": "^7.
|
|
73
|
-
"@turf/meta": "^7.
|
|
71
|
+
"@turf/boolean-disjoint": "^7.2.0",
|
|
72
|
+
"@turf/helpers": "^7.2.0",
|
|
73
|
+
"@turf/meta": "^7.2.0",
|
|
74
74
|
"@types/geojson": "^7946.0.10",
|
|
75
|
-
"tslib": "^2.
|
|
75
|
+
"tslib": "^2.8.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
78
78
|
}
|