@turf/line-split 6.5.0 → 7.0.0-alpha.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 +5 -5
- package/dist/es/index.js +7 -2
- package/dist/js/index.js +7 -2
- package/index.d.ts +1 -1
- package/package.json +17 -15
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
Split a LineString by another GeoJSON Feature.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Parameters
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* `line` **[Feature][1]<[LineString][2]>** LineString Feature to split
|
|
12
|
+
* `splitter` **[Feature][1]\<any>** Feature used to split line
|
|
13
13
|
|
|
14
|
-
|
|
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]
|
|
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(
|
|
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(
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/line-split",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.1",
|
|
4
4
|
"description": "turf line-split module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"exports": {
|
|
32
32
|
"./package.json": "./package.json",
|
|
33
33
|
".": {
|
|
34
|
+
"types": "./index.d.ts",
|
|
34
35
|
"import": "./dist/es/index.js",
|
|
35
36
|
"require": "./dist/js/index.js"
|
|
36
37
|
}
|
|
@@ -42,11 +43,11 @@
|
|
|
42
43
|
"index.d.ts"
|
|
43
44
|
],
|
|
44
45
|
"scripts": {
|
|
45
|
-
"bench": "
|
|
46
|
+
"bench": "tsx bench.js",
|
|
46
47
|
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
|
|
47
|
-
"docs": "
|
|
48
|
+
"docs": "tsx ../../scripts/generate-readmes",
|
|
48
49
|
"test": "npm-run-all test:*",
|
|
49
|
-
"test:tape": "
|
|
50
|
+
"test:tape": "tsx test.js"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"benchmark": "*",
|
|
@@ -54,19 +55,20 @@
|
|
|
54
55
|
"npm-run-all": "*",
|
|
55
56
|
"rollup": "*",
|
|
56
57
|
"tape": "*",
|
|
58
|
+
"tsx": "*",
|
|
57
59
|
"write-json-file": "*"
|
|
58
60
|
},
|
|
59
61
|
"dependencies": {
|
|
60
|
-
"@turf/bbox": "^
|
|
61
|
-
"@turf/
|
|
62
|
-
"@turf/
|
|
63
|
-
"@turf/
|
|
64
|
-
"@turf/line-
|
|
65
|
-
"@turf/
|
|
66
|
-
"@turf/
|
|
67
|
-
"@turf/
|
|
68
|
-
"@turf/
|
|
69
|
-
"
|
|
62
|
+
"@turf/bbox": "^7.0.0-alpha.1",
|
|
63
|
+
"@turf/geojson-rbush": "^3.2.0",
|
|
64
|
+
"@turf/helpers": "^7.0.0-alpha.1",
|
|
65
|
+
"@turf/invariant": "^7.0.0-alpha.1",
|
|
66
|
+
"@turf/line-intersect": "^7.0.0-alpha.1",
|
|
67
|
+
"@turf/line-segment": "^7.0.0-alpha.1",
|
|
68
|
+
"@turf/meta": "^7.0.0-alpha.1",
|
|
69
|
+
"@turf/nearest-point-on-line": "^7.0.0-alpha.1",
|
|
70
|
+
"@turf/square": "^7.0.0-alpha.1",
|
|
71
|
+
"@turf/truncate": "^7.0.0-alpha.1"
|
|
70
72
|
},
|
|
71
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "cf7a0c507b017ca066acffd0ce23bda5b393fb5a"
|
|
72
74
|
}
|