@turf/line-split 6.5.0 → 7.0.0-alpha.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
@@ -6,12 +6,12 @@
6
6
 
7
7
  Split a LineString by another GeoJSON Feature.
8
8
 
9
- **Parameters**
9
+ ### Parameters
10
10
 
11
- - `line` **[Feature][1]<[LineString][2]>** LineString Feature to split
12
- - `splitter` **[Feature][1]<any>** Feature used to split line
11
+ * `line` **[Feature][1]<[LineString][2]>** LineString Feature to split
12
+ * `splitter` **[Feature][1]\<any>** Feature used to split line
13
13
 
14
- **Examples**
14
+ ### Examples
15
15
 
16
16
  ```javascript
17
17
  var line = turf.lineString([[120, -25], [145, -25]]);
@@ -23,7 +23,7 @@ var split = turf.lineSplit(line, splitter);
23
23
  var addToMap = [line, splitter]
24
24
  ```
25
25
 
26
- Returns **[FeatureCollection][3]&lt;[LineString][2]>** Split LineStrings
26
+ Returns **[FeatureCollection][3]<[LineString][2]>** Split LineStrings
27
27
 
28
28
  [1]: https://tools.ietf.org/html/rfc7946#section-3.2
29
29
 
package/dist/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import rbush from 'geojson-rbush';
1
+ import rbush from '@turf/geojson-rbush';
2
2
  import square from '@turf/square';
3
3
  import bbox from '@turf/bbox';
4
4
  import truncate from '@turf/truncate';
@@ -51,7 +51,12 @@ function lineSplit(line, splitter) {
51
51
  case "MultiLineString":
52
52
  case "Polygon":
53
53
  case "MultiPolygon":
54
- return splitLineWithPoints(line, lineIntersect(line, truncatedSplitter));
54
+ return splitLineWithPoints(
55
+ line,
56
+ lineIntersect(line, truncatedSplitter, {
57
+ ignoreSelfIntersections: true,
58
+ })
59
+ );
55
60
  }
56
61
  }
57
62
 
package/dist/js/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var rbush = require('geojson-rbush');
3
+ var rbush = require('@turf/geojson-rbush');
4
4
  var square = require('@turf/square');
5
5
  var bbox = require('@turf/bbox');
6
6
  var truncate = require('@turf/truncate');
@@ -63,7 +63,12 @@ function lineSplit(line, splitter) {
63
63
  case "MultiLineString":
64
64
  case "Polygon":
65
65
  case "MultiPolygon":
66
- return splitLineWithPoints(line, lineIntersect__default['default'](line, truncatedSplitter));
66
+ return splitLineWithPoints(
67
+ line,
68
+ lineIntersect__default['default'](line, truncatedSplitter, {
69
+ ignoreSelfIntersections: true,
70
+ })
71
+ );
67
72
  }
68
73
  }
69
74
 
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  MultiLineString,
8
8
  Polygon,
9
9
  MultiPolygon,
10
- } from "@turf/helpers";
10
+ } from "geojson";
11
11
 
12
12
  export type Splitter = Feature<
13
13
  Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/line-split",
3
- "version": "6.5.0",
3
+ "version": "7.0.0-alpha.0",
4
4
  "description": "turf line-split module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -57,16 +57,16 @@
57
57
  "write-json-file": "*"
58
58
  },
59
59
  "dependencies": {
60
- "@turf/bbox": "^6.5.0",
61
- "@turf/helpers": "^6.5.0",
62
- "@turf/invariant": "^6.5.0",
63
- "@turf/line-intersect": "^6.5.0",
64
- "@turf/line-segment": "^6.5.0",
65
- "@turf/meta": "^6.5.0",
66
- "@turf/nearest-point-on-line": "^6.5.0",
67
- "@turf/square": "^6.5.0",
68
- "@turf/truncate": "^6.5.0",
69
- "geojson-rbush": "3.x"
60
+ "@turf/bbox": "^7.0.0-alpha.0",
61
+ "@turf/geojson-rbush": "^3.2.0",
62
+ "@turf/helpers": "^7.0.0-alpha.0",
63
+ "@turf/invariant": "^7.0.0-alpha.0",
64
+ "@turf/line-intersect": "^7.0.0-alpha.0",
65
+ "@turf/line-segment": "^7.0.0-alpha.0",
66
+ "@turf/meta": "^7.0.0-alpha.0",
67
+ "@turf/nearest-point-on-line": "^7.0.0-alpha.0",
68
+ "@turf/square": "^7.0.0-alpha.0",
69
+ "@turf/truncate": "^7.0.0-alpha.0"
70
70
  },
71
- "gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
71
+ "gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189"
72
72
  }