@turf/ellipse 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 +13 -12
- package/dist/es/index.js +0 -0
- package/dist/js/index.js +0 -0
- package/index.d.ts +16 -2
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -6,19 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
Takes a [Point][1] and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Parameters
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `options.angle` **[number][3]** angle of rotation (along the vertical axis), from North in decimal degrees, negative clockwise (optional, default `0`)
|
|
16
|
-
- `options.pivot` **[Coord][2]** point around which the rotation will be performed (optional, default `'origin'`)
|
|
17
|
-
- `options.steps` **[number][3]** number of steps (optional, default `64`)
|
|
18
|
-
- `options.units` **[string][5]** unit of measurement for axes (optional, default `'kilometers'`)
|
|
19
|
-
- `options.properties` **[Object][4]** properties (optional, default `{}`)
|
|
11
|
+
* `center` **[Coord][2]** center point
|
|
12
|
+
* `xSemiAxis` **[number][3]** semi (major) axis of the ellipse along the x-axis
|
|
13
|
+
* `ySemiAxis` **[number][3]** semi (minor) axis of the ellipse along the y-axis
|
|
14
|
+
* `options` **[Object][4]** Optional parameters (optional, default `{}`)
|
|
20
15
|
|
|
21
|
-
**
|
|
16
|
+
* `options.angle` **[number][3]** angle of rotation in decimal degrees, positive clockwise (optional, default `0`)
|
|
17
|
+
* `options.pivot` **[Coord][2]** point around which the rotation will be performed (optional, default `'origin'`)
|
|
18
|
+
* `options.steps` **[number][3]** number of steps (optional, default `64`)
|
|
19
|
+
* `options.units` **[string][5]** unit of measurement for axes (optional, default `'kilometers'`)
|
|
20
|
+
* `options.properties` **[Object][4]** properties (optional, default `{}`)
|
|
21
|
+
|
|
22
|
+
### Examples
|
|
22
23
|
|
|
23
24
|
```javascript
|
|
24
25
|
var center = [-75, 40];
|
|
@@ -30,7 +31,7 @@ var ellipse = turf.ellipse(center, xSemiAxis, ySemiAxis);
|
|
|
30
31
|
var addToMap = [turf.point(center), ellipse]
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
Returns **[Feature][6]
|
|
34
|
+
Returns **[Feature][6]<[Polygon][7]>** ellipse polygon
|
|
34
35
|
|
|
35
36
|
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
|
|
36
37
|
|
package/dist/es/index.js
CHANGED
|
File without changes
|
package/dist/js/index.js
CHANGED
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Feature,
|
|
1
|
+
import { Feature, Polygon, GeoJsonProperties } from "geojson";
|
|
2
|
+
import { Coord, Units } from "@turf/helpers";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* http://turfjs.org/docs/#ellipse
|
|
@@ -8,8 +9,21 @@ export default function (
|
|
|
8
9
|
xSemiAxis: number,
|
|
9
10
|
ySemiAxis: number,
|
|
10
11
|
options?: {
|
|
12
|
+
/** default 64 */
|
|
11
13
|
steps?: number;
|
|
14
|
+
/** default kilometers */
|
|
12
15
|
units?: Units;
|
|
13
|
-
properties?:
|
|
16
|
+
properties?: GeoJsonProperties;
|
|
17
|
+
/**
|
|
18
|
+
* Angle of rotation in decimal degrees, positive clockwise
|
|
19
|
+
* default 0
|
|
20
|
+
*/
|
|
21
|
+
angle?: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* point around which the rotation will be performed
|
|
25
|
+
* default is the point specified by center
|
|
26
|
+
*/
|
|
27
|
+
pivot?: Coord;
|
|
14
28
|
}
|
|
15
29
|
): Feature<Polygon>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/ellipse",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
4
|
"description": "turf ellipse module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@mapbox/geojsonhint": "*",
|
|
50
|
-
"@turf/bbox-polygon": "^
|
|
51
|
-
"@turf/circle": "^
|
|
52
|
-
"@turf/destination": "^
|
|
53
|
-
"@turf/truncate": "^
|
|
50
|
+
"@turf/bbox-polygon": "^7.0.0-alpha.0",
|
|
51
|
+
"@turf/circle": "^7.0.0-alpha.0",
|
|
52
|
+
"@turf/destination": "^7.0.0-alpha.0",
|
|
53
|
+
"@turf/truncate": "^7.0.0-alpha.0",
|
|
54
54
|
"benchmark": "*",
|
|
55
55
|
"glob": "*",
|
|
56
56
|
"load-json-file": "*",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"write-json-file": "*"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@turf/helpers": "^
|
|
64
|
-
"@turf/invariant": "^
|
|
65
|
-
"@turf/rhumb-destination": "^
|
|
66
|
-
"@turf/transform-rotate": "^
|
|
63
|
+
"@turf/helpers": "^7.0.0-alpha.0",
|
|
64
|
+
"@turf/invariant": "^7.0.0-alpha.0",
|
|
65
|
+
"@turf/rhumb-destination": "^7.0.0-alpha.0",
|
|
66
|
+
"@turf/transform-rotate": "^7.0.0-alpha.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189"
|
|
69
69
|
}
|