@turf/isolines 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 +12 -11
- package/dist/es/index.js +61 -589
- package/dist/es/lib/grid-to-matrix.js +101 -0
- package/dist/es/lib/marchingsquares-isocontours.js +385 -0
- package/dist/js/index.d.ts +36 -0
- package/dist/js/index.js +65 -598
- package/dist/js/lib/grid-to-matrix.d.ts +37 -0
- package/dist/js/lib/grid-to-matrix.js +104 -0
- package/dist/js/lib/marchingsquares-isocontours.d.ts +1 -0
- package/dist/js/lib/marchingsquares-isocontours.js +388 -0
- package/package.json +25 -20
- package/index.d.ts +0 -19
package/README.md
CHANGED
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
Takes a grid [FeatureCollection][1] of [Point][2] features with z-values and an array of
|
|
8
8
|
value breaks and generates [isolines][3].
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
### Parameters
|
|
11
|
+
|
|
12
|
+
* `pointGrid` **[FeatureCollection][4]<[Point][5]>** input points
|
|
13
|
+
* `breaks` **[Array][6]<[number][7]>** values of `zProperty` where to draw isolines
|
|
14
|
+
* `options` **[Object][8]** Optional parameters (optional, default `{}`)
|
|
15
|
+
|
|
16
|
+
* `options.zProperty` **[string][9]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`)
|
|
17
|
+
* `options.commonProperties` **[Object][8]** GeoJSON properties passed to ALL isolines (optional, default `{}`)
|
|
18
|
+
* `options.breaksProperties` **[Array][6]<[Object][8]>** GeoJSON properties passed, in order, to the correspondent isoline;
|
|
18
19
|
the breaks array will define the order in which the isolines are created (optional, default `[]`)
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
### Examples
|
|
21
22
|
|
|
22
23
|
```javascript
|
|
23
24
|
// create a grid of points with random z-values in their properties
|
|
@@ -36,13 +37,13 @@ var lines = turf.isolines(pointGrid, breaks, {zProperty: 'temperature'});
|
|
|
36
37
|
var addToMap = [lines];
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
Returns **[FeatureCollection][4]
|
|
40
|
+
Returns **[FeatureCollection][4]<[MultiLineString][10]>** a FeatureCollection of [MultiLineString][11] features representing isolines
|
|
40
41
|
|
|
41
42
|
[1]: https://tools.ietf.org/html/rfc7946#section-3.3
|
|
42
43
|
|
|
43
44
|
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2
|
|
44
45
|
|
|
45
|
-
[3]:
|
|
46
|
+
[3]: https://en.wikipedia.org/wiki/Contour_line
|
|
46
47
|
|
|
47
48
|
[4]: https://tools.ietf.org/html/rfc7946#section-3.3
|
|
48
49
|
|