@turf/line-chunk 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 +9 -8
- package/dist/es/index.js +0 -0
- package/dist/js/index.js +0 -0
- package/index.d.ts +2 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
Divides a [LineString][1] into chunks of a specified length.
|
|
8
8
|
If the line is shorter than the segment length then the original line is returned.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
### Parameters
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `options.units` **[string][9]** units can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
|
|
16
|
-
- `options.reverse` **[boolean][10]** reverses coordinates to start the first chunked segment at the end (optional, default `false`)
|
|
12
|
+
* `geojson` **([FeatureCollection][2] | [Geometry][3] | [Feature][4]<([LineString][5] | [MultiLineString][6])>)** the lines to split
|
|
13
|
+
* `segmentLength` **[number][7]** how long to make each segment
|
|
14
|
+
* `options` **[Object][8]** Optional parameters (optional, default `{}`)
|
|
17
15
|
|
|
18
|
-
**
|
|
16
|
+
* `options.units` **[string][9]** units can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
|
|
17
|
+
* `options.reverse` **[boolean][10]** reverses coordinates to start the first chunked segment at the end (optional, default `false`)
|
|
18
|
+
|
|
19
|
+
### Examples
|
|
19
20
|
|
|
20
21
|
```javascript
|
|
21
22
|
var line = turf.lineString([[-95, 40], [-93, 45], [-85, 50]]);
|
|
@@ -26,7 +27,7 @@ var chunk = turf.lineChunk(line, 15, {units: 'miles'});
|
|
|
26
27
|
var addToMap = [chunk];
|
|
27
28
|
```
|
|
28
29
|
|
|
29
|
-
Returns **[FeatureCollection][2]
|
|
30
|
+
Returns **[FeatureCollection][2]<[LineString][5]>** collection of line segments
|
|
30
31
|
|
|
31
32
|
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4
|
|
32
33
|
|
package/dist/es/index.js
CHANGED
|
File without changes
|
package/dist/js/index.js
CHANGED
|
File without changes
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/line-chunk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
4
|
"description": "turf line-chunk module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"docs": "node ../../scripts/generate-readmes",
|
|
51
51
|
"test": "npm-run-all test:*",
|
|
52
52
|
"test:tape": "node -r esm test.js",
|
|
53
|
-
"test:types": "tsc --esModuleInterop --noEmit types.ts"
|
|
53
|
+
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@turf/truncate": "^
|
|
56
|
+
"@turf/truncate": "^7.0.0-alpha.0",
|
|
57
57
|
"benchmark": "*",
|
|
58
58
|
"load-json-file": "*",
|
|
59
59
|
"npm-run-all": "*",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"write-json-file": "*"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@turf/helpers": "^
|
|
66
|
-
"@turf/length": "^
|
|
67
|
-
"@turf/line-slice-along": "^
|
|
68
|
-
"@turf/meta": "^
|
|
65
|
+
"@turf/helpers": "^7.0.0-alpha.0",
|
|
66
|
+
"@turf/length": "^7.0.0-alpha.0",
|
|
67
|
+
"@turf/line-slice-along": "^7.0.0-alpha.0",
|
|
68
|
+
"@turf/meta": "^7.0.0-alpha.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189"
|
|
71
71
|
}
|