@turf/line-intersect 7.0.0-alpha.111 → 7.0.0-alpha.114

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.
@@ -3,7 +3,12 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
 
4
4
  // index.ts
5
5
  var _helpers = require('@turf/helpers');
6
+
7
+ // lib/sweepline-intersections-export.ts
6
8
  var _sweeplineintersections = require('sweepline-intersections'); var _sweeplineintersections2 = _interopRequireDefault(_sweeplineintersections);
9
+ var sweeplineIntersections = _sweeplineintersections2.default;
10
+
11
+ // index.ts
7
12
  function lineIntersect(line1, line2, options = {}) {
8
13
  const { removeDuplicates = true, ignoreSelfIntersections = false } = options;
9
14
  let features = [];
@@ -21,7 +26,7 @@ function lineIntersect(line1, line2, options = {}) {
21
26
  else if (line2.type === "LineString" || line2.type === "Polygon" || line2.type === "MultiLineString" || line2.type === "MultiPolygon") {
22
27
  features.push(_helpers.feature.call(void 0, line2));
23
28
  }
24
- const intersections = _sweeplineintersections2.default.call(void 0,
29
+ const intersections = sweeplineIntersections(
25
30
  _helpers.featureCollection.call(void 0, features),
26
31
  ignoreSelfIntersections
27
32
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";;;;AAAA,SAAS,SAAS,mBAAmB,aAAa;AAUlD,OAAO,uBAAyC;AAoBhD,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,MAAM,IAAI;AACrE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAxDS;AA2DT,IAAO,8BAAQ","sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport findIntersections, { Intersection } from \"sweepline-intersections\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = false } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\n"]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"names":[],"mappings":";;;;AAAA,SAAS,SAAS,mBAAmB,aAAa;;;ACIlD,OAAO,SAAS;AAET,IAAM,yBAAyB;;;ADyBtC,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,MAAM,IAAI;AACrE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAxDS;AA2DT,IAAO,8BAAQ","sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = false } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"sweepline-intersections\";\n\nexport const sweeplineIntersections = lib as unknown as typeof lib.default;\n"]}
@@ -3,7 +3,12 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
 
4
4
  // index.ts
5
5
  import { feature, featureCollection, point } from "@turf/helpers";
6
- import findIntersections from "sweepline-intersections";
6
+
7
+ // lib/sweepline-intersections-export.ts
8
+ import lib from "sweepline-intersections";
9
+ var sweeplineIntersections = lib;
10
+
11
+ // index.ts
7
12
  function lineIntersect(line1, line2, options = {}) {
8
13
  const { removeDuplicates = true, ignoreSelfIntersections = false } = options;
9
14
  let features = [];
@@ -21,7 +26,7 @@ function lineIntersect(line1, line2, options = {}) {
21
26
  else if (line2.type === "LineString" || line2.type === "Polygon" || line2.type === "MultiLineString" || line2.type === "MultiPolygon") {
22
27
  features.push(feature(line2));
23
28
  }
24
- const intersections = findIntersections(
29
+ const intersections = sweeplineIntersections(
25
30
  featureCollection(features),
26
31
  ignoreSelfIntersections
27
32
  );
@@ -46,4 +51,4 @@ export {
46
51
  turf_line_intersect_default as default,
47
52
  lineIntersect
48
53
  };
49
- //# sourceMappingURL=index.mjs.map
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = false } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"sweepline-intersections\";\n\nexport const sweeplineIntersections = lib as unknown as typeof lib.default;\n"],"mappings":";;;;AAAA,SAAS,SAAS,mBAAmB,aAAa;;;ACIlD,OAAO,SAAS;AAET,IAAM,yBAAyB;;;ADyBtC,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,MAAM,IAAI;AACrE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAxDS;AA2DT,IAAO,8BAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/line-intersect",
3
- "version": "7.0.0-alpha.111+08576cb50",
3
+ "version": "7.0.0-alpha.114+e0bdd0add",
4
4
  "description": "turf line-intersect module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -27,19 +27,19 @@
27
27
  "line",
28
28
  "intersect"
29
29
  ],
30
- "type": "commonjs",
30
+ "type": "module",
31
31
  "main": "dist/cjs/index.cjs",
32
- "module": "dist/esm/index.mjs",
33
- "types": "dist/cjs/index.d.ts",
32
+ "module": "dist/esm/index.js",
33
+ "types": "dist/esm/index.d.ts",
34
34
  "exports": {
35
35
  "./package.json": "./package.json",
36
36
  ".": {
37
37
  "import": {
38
- "types": "./dist/esm/index.d.mts",
39
- "default": "./dist/esm/index.mjs"
38
+ "types": "./dist/esm/index.d.ts",
39
+ "default": "./dist/esm/index.js"
40
40
  },
41
41
  "require": {
42
- "types": "./dist/cjs/index.d.ts",
42
+ "types": "./dist/cjs/index.d.cts",
43
43
  "default": "./dist/cjs/index.cjs"
44
44
  }
45
45
  }
@@ -56,7 +56,7 @@
56
56
  "test:tape": "tsx test.ts"
57
57
  },
58
58
  "devDependencies": {
59
- "@turf/truncate": "^7.0.0-alpha.111+08576cb50",
59
+ "@turf/truncate": "^7.0.0-alpha.114+e0bdd0add",
60
60
  "@types/benchmark": "^2.1.5",
61
61
  "@types/tape": "^4.2.32",
62
62
  "benchmark": "^2.1.4",
@@ -69,9 +69,9 @@
69
69
  "write-json-file": "^5.0.0"
70
70
  },
71
71
  "dependencies": {
72
- "@turf/helpers": "^7.0.0-alpha.111+08576cb50",
72
+ "@turf/helpers": "^7.0.0-alpha.114+e0bdd0add",
73
73
  "sweepline-intersections": "^1.5.0",
74
74
  "tslib": "^2.6.2"
75
75
  },
76
- "gitHead": "08576cb50376e0199aea02dbd887e3af83672246"
76
+ "gitHead": "e0bdd0add87f21a4430f8884736096d1ac6fe4cd"
77
77
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport findIntersections, { Intersection } from \"sweepline-intersections\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = false } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\n"],"mappings":";;;;AAAA,SAAS,SAAS,mBAAmB,aAAa;AAUlD,OAAO,uBAAyC;AAoBhD,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,MAAM,IAAI;AACrE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS;AAAW,aAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAxDS;AA2DT,IAAO,8BAAQ;","names":[]}
File without changes
File without changes