@turf/helpers 7.0.0-alpha.2 → 7.1.0-alpha.7
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 +4 -9
- package/dist/cjs/index.cjs +301 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/{es/index.js → cjs/index.d.cts} +87 -258
- package/dist/{js → esm}/index.d.ts +51 -39
- package/dist/esm/index.js +301 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +29 -24
- package/dist/es/lib/geojson.js +0 -0
- package/dist/es/package.json +0 -1
- package/dist/js/index.js +0 -687
- package/dist/js/lib/geojson.d.ts +0 -10
- package/dist/js/lib/geojson.js +0 -2
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Feature, Point, Position, LineString, MultiLineString, Polygon, MultiPolygon, FeatureCollection, Geometry, GeometryCollection, GeometryObject, GeoJsonProperties, BBox, MultiPoint } from 'geojson';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Id
|
|
5
|
+
*
|
|
6
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2
|
|
7
|
+
* If a Feature has a commonly used identifier, that identifier SHOULD be included as a member of
|
|
8
|
+
* the Feature object with the name "id", and the value of this member is either a JSON string or number.
|
|
9
|
+
*
|
|
10
|
+
* Should be contributed to @types/geojson
|
|
11
|
+
*/
|
|
12
|
+
type Id = string | number;
|
|
13
|
+
|
|
14
|
+
type Coord = Feature<Point> | Point | Position;
|
|
15
|
+
type Units = "meters" | "metres" | "millimeters" | "millimetres" | "centimeters" | "centimetres" | "kilometers" | "kilometres" | "miles" | "nauticalmiles" | "inches" | "yards" | "feet" | "radians" | "degrees";
|
|
16
|
+
type AreaUnits = Exclude<Units, "radians" | "degrees"> | "acres" | "hectares";
|
|
17
|
+
type Grid = "point" | "square" | "hex" | "triangle";
|
|
18
|
+
type Corners = "sw" | "se" | "nw" | "ne" | "center" | "centroid";
|
|
19
|
+
type Lines = LineString | MultiLineString | Polygon | MultiPolygon;
|
|
20
|
+
type AllGeoJSON = Feature | FeatureCollection | Geometry | GeometryCollection;
|
|
11
21
|
/**
|
|
12
22
|
* @module helpers
|
|
13
23
|
*/
|
|
@@ -17,7 +27,7 @@ export declare type AllGeoJSON = Feature | FeatureCollection | Geometry | Geomet
|
|
|
17
27
|
* @memberof helpers
|
|
18
28
|
* @type {number}
|
|
19
29
|
*/
|
|
20
|
-
|
|
30
|
+
declare const earthRadius = 6371008.8;
|
|
21
31
|
/**
|
|
22
32
|
* Unit of measurement factors using a spherical (non-ellipsoid) earth radius.
|
|
23
33
|
*
|
|
@@ -26,7 +36,7 @@ export declare const earthRadius = 6371008.8;
|
|
|
26
36
|
* @memberof helpers
|
|
27
37
|
* @type {Object}
|
|
28
38
|
*/
|
|
29
|
-
|
|
39
|
+
declare const factors: Record<Units, number>;
|
|
30
40
|
/**
|
|
31
41
|
|
|
32
42
|
* Area of measurement factors based on 1 square meter.
|
|
@@ -34,7 +44,7 @@ export declare const factors: Record<Units, number>;
|
|
|
34
44
|
* @memberof helpers
|
|
35
45
|
* @type {Object}
|
|
36
46
|
*/
|
|
37
|
-
|
|
47
|
+
declare const areaFactors: Record<AreaUnits, number>;
|
|
38
48
|
/**
|
|
39
49
|
* Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.
|
|
40
50
|
*
|
|
@@ -55,7 +65,7 @@ export declare const areaFactors: Record<AreaUnits, number>;
|
|
|
55
65
|
*
|
|
56
66
|
* //=feature
|
|
57
67
|
*/
|
|
58
|
-
|
|
68
|
+
declare function feature<G extends GeometryObject = Geometry, P extends GeoJsonProperties = GeoJsonProperties>(geom: G | null, properties?: P, options?: {
|
|
59
69
|
bbox?: BBox;
|
|
60
70
|
id?: Id;
|
|
61
71
|
}): Feature<G, P>;
|
|
@@ -74,7 +84,7 @@ export declare function feature<G extends GeometryObject = Geometry, P = GeoJson
|
|
|
74
84
|
* var geometry = turf.geometry(type, coordinates);
|
|
75
85
|
* // => geometry
|
|
76
86
|
*/
|
|
77
|
-
|
|
87
|
+
declare function geometry(type: "Point" | "LineString" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon", coordinates: any[], _options?: Record<string, never>): Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon;
|
|
78
88
|
/**
|
|
79
89
|
* Creates a {@link Point} {@link Feature} from a Position.
|
|
80
90
|
*
|
|
@@ -90,7 +100,7 @@ export declare function geometry(type: "Point" | "LineString" | "Polygon" | "Mul
|
|
|
90
100
|
*
|
|
91
101
|
* //=point
|
|
92
102
|
*/
|
|
93
|
-
|
|
103
|
+
declare function point<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position, properties?: P, options?: {
|
|
94
104
|
bbox?: BBox;
|
|
95
105
|
id?: Id;
|
|
96
106
|
}): Feature<Point, P>;
|
|
@@ -114,7 +124,7 @@ export declare function point<P = GeoJsonProperties>(coordinates: Position, prop
|
|
|
114
124
|
*
|
|
115
125
|
* //=points
|
|
116
126
|
*/
|
|
117
|
-
|
|
127
|
+
declare function points<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
|
|
118
128
|
bbox?: BBox;
|
|
119
129
|
id?: Id;
|
|
120
130
|
}): FeatureCollection<Point, P>;
|
|
@@ -133,7 +143,7 @@ export declare function points<P = GeoJsonProperties>(coordinates: Position[], p
|
|
|
133
143
|
*
|
|
134
144
|
* //=polygon
|
|
135
145
|
*/
|
|
136
|
-
|
|
146
|
+
declare function polygon<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
|
|
137
147
|
bbox?: BBox;
|
|
138
148
|
id?: Id;
|
|
139
149
|
}): Feature<Polygon, P>;
|
|
@@ -155,7 +165,7 @@ export declare function polygon<P = GeoJsonProperties>(coordinates: Position[][]
|
|
|
155
165
|
*
|
|
156
166
|
* //=polygons
|
|
157
167
|
*/
|
|
158
|
-
|
|
168
|
+
declare function polygons<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][][], properties?: P, options?: {
|
|
159
169
|
bbox?: BBox;
|
|
160
170
|
id?: Id;
|
|
161
171
|
}): FeatureCollection<Polygon, P>;
|
|
@@ -176,7 +186,7 @@ export declare function polygons<P = GeoJsonProperties>(coordinates: Position[][
|
|
|
176
186
|
* //=linestring1
|
|
177
187
|
* //=linestring2
|
|
178
188
|
*/
|
|
179
|
-
|
|
189
|
+
declare function lineString<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
|
|
180
190
|
bbox?: BBox;
|
|
181
191
|
id?: Id;
|
|
182
192
|
}): Feature<LineString, P>;
|
|
@@ -199,7 +209,7 @@ export declare function lineString<P = GeoJsonProperties>(coordinates: Position[
|
|
|
199
209
|
*
|
|
200
210
|
* //=linestrings
|
|
201
211
|
*/
|
|
202
|
-
|
|
212
|
+
declare function lineStrings<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
|
|
203
213
|
bbox?: BBox;
|
|
204
214
|
id?: Id;
|
|
205
215
|
}): FeatureCollection<LineString, P>;
|
|
@@ -225,7 +235,7 @@ export declare function lineStrings<P = GeoJsonProperties>(coordinates: Position
|
|
|
225
235
|
*
|
|
226
236
|
* //=collection
|
|
227
237
|
*/
|
|
228
|
-
|
|
238
|
+
declare function featureCollection<G extends GeometryObject = Geometry, P extends GeoJsonProperties = GeoJsonProperties>(features: Array<Feature<G, P>>, options?: {
|
|
229
239
|
bbox?: BBox;
|
|
230
240
|
id?: Id;
|
|
231
241
|
}): FeatureCollection<G, P>;
|
|
@@ -246,7 +256,7 @@ export declare function featureCollection<G extends GeometryObject = Geometry, P
|
|
|
246
256
|
*
|
|
247
257
|
* //=multiLine
|
|
248
258
|
*/
|
|
249
|
-
|
|
259
|
+
declare function multiLineString<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
|
|
250
260
|
bbox?: BBox;
|
|
251
261
|
id?: Id;
|
|
252
262
|
}): Feature<MultiLineString, P>;
|
|
@@ -267,7 +277,7 @@ export declare function multiLineString<P = GeoJsonProperties>(coordinates: Posi
|
|
|
267
277
|
*
|
|
268
278
|
* //=multiPt
|
|
269
279
|
*/
|
|
270
|
-
|
|
280
|
+
declare function multiPoint<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
|
|
271
281
|
bbox?: BBox;
|
|
272
282
|
id?: Id;
|
|
273
283
|
}): Feature<MultiPoint, P>;
|
|
@@ -289,7 +299,7 @@ export declare function multiPoint<P = GeoJsonProperties>(coordinates: Position[
|
|
|
289
299
|
* //=multiPoly
|
|
290
300
|
*
|
|
291
301
|
*/
|
|
292
|
-
|
|
302
|
+
declare function multiPolygon<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][][], properties?: P, options?: {
|
|
293
303
|
bbox?: BBox;
|
|
294
304
|
id?: Id;
|
|
295
305
|
}): Feature<MultiPolygon, P>;
|
|
@@ -311,7 +321,7 @@ export declare function multiPolygon<P = GeoJsonProperties>(coordinates: Positio
|
|
|
311
321
|
*
|
|
312
322
|
* // => collection
|
|
313
323
|
*/
|
|
314
|
-
|
|
324
|
+
declare function geometryCollection<P extends GeoJsonProperties = GeoJsonProperties>(geometries: Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>, properties?: P, options?: {
|
|
315
325
|
bbox?: BBox;
|
|
316
326
|
id?: Id;
|
|
317
327
|
}): Feature<GeometryCollection, P>;
|
|
@@ -328,7 +338,7 @@ export declare function geometryCollection<P = GeoJsonProperties>(geometries: Ar
|
|
|
328
338
|
* turf.round(120.4321, 2)
|
|
329
339
|
* //=120.43
|
|
330
340
|
*/
|
|
331
|
-
|
|
341
|
+
declare function round(num: number, precision?: number): number;
|
|
332
342
|
/**
|
|
333
343
|
* Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.
|
|
334
344
|
* Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
|
|
@@ -339,7 +349,7 @@ export declare function round(num: number, precision?: number): number;
|
|
|
339
349
|
* meters, kilometres, kilometers.
|
|
340
350
|
* @returns {number} distance
|
|
341
351
|
*/
|
|
342
|
-
|
|
352
|
+
declare function radiansToLength(radians: number, units?: Units): number;
|
|
343
353
|
/**
|
|
344
354
|
* Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians
|
|
345
355
|
* Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
|
|
@@ -350,7 +360,7 @@ export declare function radiansToLength(radians: number, units?: Units): number;
|
|
|
350
360
|
* meters, kilometres, kilometers.
|
|
351
361
|
* @returns {number} radians
|
|
352
362
|
*/
|
|
353
|
-
|
|
363
|
+
declare function lengthToRadians(distance: number, units?: Units): number;
|
|
354
364
|
/**
|
|
355
365
|
* Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees
|
|
356
366
|
* Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet
|
|
@@ -361,7 +371,7 @@ export declare function lengthToRadians(distance: number, units?: Units): number
|
|
|
361
371
|
* meters, kilometres, kilometers.
|
|
362
372
|
* @returns {number} degrees
|
|
363
373
|
*/
|
|
364
|
-
|
|
374
|
+
declare function lengthToDegrees(distance: number, units?: Units): number;
|
|
365
375
|
/**
|
|
366
376
|
* Converts any bearing angle from the north line direction (positive clockwise)
|
|
367
377
|
* and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
|
|
@@ -370,7 +380,7 @@ export declare function lengthToDegrees(distance: number, units?: Units): number
|
|
|
370
380
|
* @param {number} bearing angle, between -180 and +180 degrees
|
|
371
381
|
* @returns {number} angle between 0 and 360 degrees
|
|
372
382
|
*/
|
|
373
|
-
|
|
383
|
+
declare function bearingToAzimuth(bearing: number): number;
|
|
374
384
|
/**
|
|
375
385
|
* Converts an angle in radians to degrees
|
|
376
386
|
*
|
|
@@ -378,7 +388,7 @@ export declare function bearingToAzimuth(bearing: number): number;
|
|
|
378
388
|
* @param {number} radians angle in radians
|
|
379
389
|
* @returns {number} degrees between 0 and 360 degrees
|
|
380
390
|
*/
|
|
381
|
-
|
|
391
|
+
declare function radiansToDegrees(radians: number): number;
|
|
382
392
|
/**
|
|
383
393
|
* Converts an angle in degrees to radians
|
|
384
394
|
*
|
|
@@ -386,7 +396,7 @@ export declare function radiansToDegrees(radians: number): number;
|
|
|
386
396
|
* @param {number} degrees angle between 0 and 360 degrees
|
|
387
397
|
* @returns {number} angle in radians
|
|
388
398
|
*/
|
|
389
|
-
|
|
399
|
+
declare function degreesToRadians(degrees: number): number;
|
|
390
400
|
/**
|
|
391
401
|
* Converts a length to the requested unit.
|
|
392
402
|
* Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
|
|
@@ -396,7 +406,7 @@ export declare function degreesToRadians(degrees: number): number;
|
|
|
396
406
|
* @param {Units} [finalUnit="kilometers"] returned unit
|
|
397
407
|
* @returns {number} the converted length
|
|
398
408
|
*/
|
|
399
|
-
|
|
409
|
+
declare function convertLength(length: number, originalUnit?: Units, finalUnit?: Units): number;
|
|
400
410
|
/**
|
|
401
411
|
* Converts a area to the requested unit.
|
|
402
412
|
* Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares
|
|
@@ -405,7 +415,7 @@ export declare function convertLength(length: number, originalUnit?: Units, fina
|
|
|
405
415
|
* @param {Units} [finalUnit="kilometers"] returned unit
|
|
406
416
|
* @returns {number} the converted area
|
|
407
417
|
*/
|
|
408
|
-
|
|
418
|
+
declare function convertArea(area: number, originalUnit?: AreaUnits, finalUnit?: AreaUnits): number;
|
|
409
419
|
/**
|
|
410
420
|
* isNumber
|
|
411
421
|
*
|
|
@@ -417,7 +427,7 @@ export declare function convertArea(area: number, originalUnit?: AreaUnits, fina
|
|
|
417
427
|
* turf.isNumber('foo')
|
|
418
428
|
* //=false
|
|
419
429
|
*/
|
|
420
|
-
|
|
430
|
+
declare function isNumber(num: any): boolean;
|
|
421
431
|
/**
|
|
422
432
|
* isObject
|
|
423
433
|
*
|
|
@@ -429,7 +439,7 @@ export declare function isNumber(num: any): boolean;
|
|
|
429
439
|
* turf.isObject('foo')
|
|
430
440
|
* //=false
|
|
431
441
|
*/
|
|
432
|
-
|
|
442
|
+
declare function isObject(input: any): boolean;
|
|
433
443
|
/**
|
|
434
444
|
* Validate BBox
|
|
435
445
|
*
|
|
@@ -451,7 +461,7 @@ export declare function isObject(input: any): boolean;
|
|
|
451
461
|
* validateBBox(undefined)
|
|
452
462
|
* //=Error
|
|
453
463
|
*/
|
|
454
|
-
|
|
464
|
+
declare function validateBBox(bbox: any): void;
|
|
455
465
|
/**
|
|
456
466
|
* Validate Id
|
|
457
467
|
*
|
|
@@ -473,4 +483,6 @@ export declare function validateBBox(bbox: any): void;
|
|
|
473
483
|
* validateId(undefined)
|
|
474
484
|
* //=Error
|
|
475
485
|
*/
|
|
476
|
-
|
|
486
|
+
declare function validateId(id: any): void;
|
|
487
|
+
|
|
488
|
+
export { type AllGeoJSON, type AreaUnits, type Coord, type Corners, type Grid, type Id, type Lines, type Units, areaFactors, bearingToAzimuth, convertArea, convertLength, degreesToRadians, earthRadius, factors, feature, featureCollection, geometry, geometryCollection, isNumber, isObject, lengthToDegrees, lengthToRadians, lineString, lineStrings, multiLineString, multiPoint, multiPolygon, point, points, polygon, polygons, radiansToDegrees, radiansToLength, round, validateBBox, validateId };
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// index.ts
|
|
2
|
+
var earthRadius = 63710088e-1;
|
|
3
|
+
var factors = {
|
|
4
|
+
centimeters: earthRadius * 100,
|
|
5
|
+
centimetres: earthRadius * 100,
|
|
6
|
+
degrees: 360 / (2 * Math.PI),
|
|
7
|
+
feet: earthRadius * 3.28084,
|
|
8
|
+
inches: earthRadius * 39.37,
|
|
9
|
+
kilometers: earthRadius / 1e3,
|
|
10
|
+
kilometres: earthRadius / 1e3,
|
|
11
|
+
meters: earthRadius,
|
|
12
|
+
metres: earthRadius,
|
|
13
|
+
miles: earthRadius / 1609.344,
|
|
14
|
+
millimeters: earthRadius * 1e3,
|
|
15
|
+
millimetres: earthRadius * 1e3,
|
|
16
|
+
nauticalmiles: earthRadius / 1852,
|
|
17
|
+
radians: 1,
|
|
18
|
+
yards: earthRadius * 1.0936
|
|
19
|
+
};
|
|
20
|
+
var areaFactors = {
|
|
21
|
+
acres: 247105e-9,
|
|
22
|
+
centimeters: 1e4,
|
|
23
|
+
centimetres: 1e4,
|
|
24
|
+
feet: 10.763910417,
|
|
25
|
+
hectares: 1e-4,
|
|
26
|
+
inches: 1550.003100006,
|
|
27
|
+
kilometers: 1e-6,
|
|
28
|
+
kilometres: 1e-6,
|
|
29
|
+
meters: 1,
|
|
30
|
+
metres: 1,
|
|
31
|
+
miles: 386e-9,
|
|
32
|
+
nauticalmiles: 29155334959812285e-23,
|
|
33
|
+
millimeters: 1e6,
|
|
34
|
+
millimetres: 1e6,
|
|
35
|
+
yards: 1.195990046
|
|
36
|
+
};
|
|
37
|
+
function feature(geom, properties, options = {}) {
|
|
38
|
+
const feat = { type: "Feature" };
|
|
39
|
+
if (options.id === 0 || options.id) {
|
|
40
|
+
feat.id = options.id;
|
|
41
|
+
}
|
|
42
|
+
if (options.bbox) {
|
|
43
|
+
feat.bbox = options.bbox;
|
|
44
|
+
}
|
|
45
|
+
feat.properties = properties || {};
|
|
46
|
+
feat.geometry = geom;
|
|
47
|
+
return feat;
|
|
48
|
+
}
|
|
49
|
+
function geometry(type, coordinates, _options = {}) {
|
|
50
|
+
switch (type) {
|
|
51
|
+
case "Point":
|
|
52
|
+
return point(coordinates).geometry;
|
|
53
|
+
case "LineString":
|
|
54
|
+
return lineString(coordinates).geometry;
|
|
55
|
+
case "Polygon":
|
|
56
|
+
return polygon(coordinates).geometry;
|
|
57
|
+
case "MultiPoint":
|
|
58
|
+
return multiPoint(coordinates).geometry;
|
|
59
|
+
case "MultiLineString":
|
|
60
|
+
return multiLineString(coordinates).geometry;
|
|
61
|
+
case "MultiPolygon":
|
|
62
|
+
return multiPolygon(coordinates).geometry;
|
|
63
|
+
default:
|
|
64
|
+
throw new Error(type + " is invalid");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function point(coordinates, properties, options = {}) {
|
|
68
|
+
if (!coordinates) {
|
|
69
|
+
throw new Error("coordinates is required");
|
|
70
|
+
}
|
|
71
|
+
if (!Array.isArray(coordinates)) {
|
|
72
|
+
throw new Error("coordinates must be an Array");
|
|
73
|
+
}
|
|
74
|
+
if (coordinates.length < 2) {
|
|
75
|
+
throw new Error("coordinates must be at least 2 numbers long");
|
|
76
|
+
}
|
|
77
|
+
if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {
|
|
78
|
+
throw new Error("coordinates must contain numbers");
|
|
79
|
+
}
|
|
80
|
+
const geom = {
|
|
81
|
+
type: "Point",
|
|
82
|
+
coordinates
|
|
83
|
+
};
|
|
84
|
+
return feature(geom, properties, options);
|
|
85
|
+
}
|
|
86
|
+
function points(coordinates, properties, options = {}) {
|
|
87
|
+
return featureCollection(
|
|
88
|
+
coordinates.map((coords) => {
|
|
89
|
+
return point(coords, properties);
|
|
90
|
+
}),
|
|
91
|
+
options
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function polygon(coordinates, properties, options = {}) {
|
|
95
|
+
for (const ring of coordinates) {
|
|
96
|
+
if (ring.length < 4) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
"Each LinearRing of a Polygon must have 4 or more Positions."
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
if (ring[ring.length - 1].length !== ring[0].length) {
|
|
102
|
+
throw new Error("First and last Position are not equivalent.");
|
|
103
|
+
}
|
|
104
|
+
for (let j = 0; j < ring[ring.length - 1].length; j++) {
|
|
105
|
+
if (ring[ring.length - 1][j] !== ring[0][j]) {
|
|
106
|
+
throw new Error("First and last Position are not equivalent.");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const geom = {
|
|
111
|
+
type: "Polygon",
|
|
112
|
+
coordinates
|
|
113
|
+
};
|
|
114
|
+
return feature(geom, properties, options);
|
|
115
|
+
}
|
|
116
|
+
function polygons(coordinates, properties, options = {}) {
|
|
117
|
+
return featureCollection(
|
|
118
|
+
coordinates.map((coords) => {
|
|
119
|
+
return polygon(coords, properties);
|
|
120
|
+
}),
|
|
121
|
+
options
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
function lineString(coordinates, properties, options = {}) {
|
|
125
|
+
if (coordinates.length < 2) {
|
|
126
|
+
throw new Error("coordinates must be an array of two or more positions");
|
|
127
|
+
}
|
|
128
|
+
const geom = {
|
|
129
|
+
type: "LineString",
|
|
130
|
+
coordinates
|
|
131
|
+
};
|
|
132
|
+
return feature(geom, properties, options);
|
|
133
|
+
}
|
|
134
|
+
function lineStrings(coordinates, properties, options = {}) {
|
|
135
|
+
return featureCollection(
|
|
136
|
+
coordinates.map((coords) => {
|
|
137
|
+
return lineString(coords, properties);
|
|
138
|
+
}),
|
|
139
|
+
options
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
function featureCollection(features, options = {}) {
|
|
143
|
+
const fc = { type: "FeatureCollection" };
|
|
144
|
+
if (options.id) {
|
|
145
|
+
fc.id = options.id;
|
|
146
|
+
}
|
|
147
|
+
if (options.bbox) {
|
|
148
|
+
fc.bbox = options.bbox;
|
|
149
|
+
}
|
|
150
|
+
fc.features = features;
|
|
151
|
+
return fc;
|
|
152
|
+
}
|
|
153
|
+
function multiLineString(coordinates, properties, options = {}) {
|
|
154
|
+
const geom = {
|
|
155
|
+
type: "MultiLineString",
|
|
156
|
+
coordinates
|
|
157
|
+
};
|
|
158
|
+
return feature(geom, properties, options);
|
|
159
|
+
}
|
|
160
|
+
function multiPoint(coordinates, properties, options = {}) {
|
|
161
|
+
const geom = {
|
|
162
|
+
type: "MultiPoint",
|
|
163
|
+
coordinates
|
|
164
|
+
};
|
|
165
|
+
return feature(geom, properties, options);
|
|
166
|
+
}
|
|
167
|
+
function multiPolygon(coordinates, properties, options = {}) {
|
|
168
|
+
const geom = {
|
|
169
|
+
type: "MultiPolygon",
|
|
170
|
+
coordinates
|
|
171
|
+
};
|
|
172
|
+
return feature(geom, properties, options);
|
|
173
|
+
}
|
|
174
|
+
function geometryCollection(geometries, properties, options = {}) {
|
|
175
|
+
const geom = {
|
|
176
|
+
type: "GeometryCollection",
|
|
177
|
+
geometries
|
|
178
|
+
};
|
|
179
|
+
return feature(geom, properties, options);
|
|
180
|
+
}
|
|
181
|
+
function round(num, precision = 0) {
|
|
182
|
+
if (precision && !(precision >= 0)) {
|
|
183
|
+
throw new Error("precision must be a positive number");
|
|
184
|
+
}
|
|
185
|
+
const multiplier = Math.pow(10, precision || 0);
|
|
186
|
+
return Math.round(num * multiplier) / multiplier;
|
|
187
|
+
}
|
|
188
|
+
function radiansToLength(radians, units = "kilometers") {
|
|
189
|
+
const factor = factors[units];
|
|
190
|
+
if (!factor) {
|
|
191
|
+
throw new Error(units + " units is invalid");
|
|
192
|
+
}
|
|
193
|
+
return radians * factor;
|
|
194
|
+
}
|
|
195
|
+
function lengthToRadians(distance, units = "kilometers") {
|
|
196
|
+
const factor = factors[units];
|
|
197
|
+
if (!factor) {
|
|
198
|
+
throw new Error(units + " units is invalid");
|
|
199
|
+
}
|
|
200
|
+
return distance / factor;
|
|
201
|
+
}
|
|
202
|
+
function lengthToDegrees(distance, units) {
|
|
203
|
+
return radiansToDegrees(lengthToRadians(distance, units));
|
|
204
|
+
}
|
|
205
|
+
function bearingToAzimuth(bearing) {
|
|
206
|
+
let angle = bearing % 360;
|
|
207
|
+
if (angle < 0) {
|
|
208
|
+
angle += 360;
|
|
209
|
+
}
|
|
210
|
+
return angle;
|
|
211
|
+
}
|
|
212
|
+
function radiansToDegrees(radians) {
|
|
213
|
+
const degrees = radians % (2 * Math.PI);
|
|
214
|
+
return degrees * 180 / Math.PI;
|
|
215
|
+
}
|
|
216
|
+
function degreesToRadians(degrees) {
|
|
217
|
+
const radians = degrees % 360;
|
|
218
|
+
return radians * Math.PI / 180;
|
|
219
|
+
}
|
|
220
|
+
function convertLength(length, originalUnit = "kilometers", finalUnit = "kilometers") {
|
|
221
|
+
if (!(length >= 0)) {
|
|
222
|
+
throw new Error("length must be a positive number");
|
|
223
|
+
}
|
|
224
|
+
return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);
|
|
225
|
+
}
|
|
226
|
+
function convertArea(area, originalUnit = "meters", finalUnit = "kilometers") {
|
|
227
|
+
if (!(area >= 0)) {
|
|
228
|
+
throw new Error("area must be a positive number");
|
|
229
|
+
}
|
|
230
|
+
const startFactor = areaFactors[originalUnit];
|
|
231
|
+
if (!startFactor) {
|
|
232
|
+
throw new Error("invalid original units");
|
|
233
|
+
}
|
|
234
|
+
const finalFactor = areaFactors[finalUnit];
|
|
235
|
+
if (!finalFactor) {
|
|
236
|
+
throw new Error("invalid final units");
|
|
237
|
+
}
|
|
238
|
+
return area / startFactor * finalFactor;
|
|
239
|
+
}
|
|
240
|
+
function isNumber(num) {
|
|
241
|
+
return !isNaN(num) && num !== null && !Array.isArray(num);
|
|
242
|
+
}
|
|
243
|
+
function isObject(input) {
|
|
244
|
+
return input !== null && typeof input === "object" && !Array.isArray(input);
|
|
245
|
+
}
|
|
246
|
+
function validateBBox(bbox) {
|
|
247
|
+
if (!bbox) {
|
|
248
|
+
throw new Error("bbox is required");
|
|
249
|
+
}
|
|
250
|
+
if (!Array.isArray(bbox)) {
|
|
251
|
+
throw new Error("bbox must be an Array");
|
|
252
|
+
}
|
|
253
|
+
if (bbox.length !== 4 && bbox.length !== 6) {
|
|
254
|
+
throw new Error("bbox must be an Array of 4 or 6 numbers");
|
|
255
|
+
}
|
|
256
|
+
bbox.forEach((num) => {
|
|
257
|
+
if (!isNumber(num)) {
|
|
258
|
+
throw new Error("bbox must only contain numbers");
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function validateId(id) {
|
|
263
|
+
if (!id) {
|
|
264
|
+
throw new Error("id is required");
|
|
265
|
+
}
|
|
266
|
+
if (["string", "number"].indexOf(typeof id) === -1) {
|
|
267
|
+
throw new Error("id must be a number or a string");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
export {
|
|
271
|
+
areaFactors,
|
|
272
|
+
bearingToAzimuth,
|
|
273
|
+
convertArea,
|
|
274
|
+
convertLength,
|
|
275
|
+
degreesToRadians,
|
|
276
|
+
earthRadius,
|
|
277
|
+
factors,
|
|
278
|
+
feature,
|
|
279
|
+
featureCollection,
|
|
280
|
+
geometry,
|
|
281
|
+
geometryCollection,
|
|
282
|
+
isNumber,
|
|
283
|
+
isObject,
|
|
284
|
+
lengthToDegrees,
|
|
285
|
+
lengthToRadians,
|
|
286
|
+
lineString,
|
|
287
|
+
lineStrings,
|
|
288
|
+
multiLineString,
|
|
289
|
+
multiPoint,
|
|
290
|
+
multiPolygon,
|
|
291
|
+
point,
|
|
292
|
+
points,
|
|
293
|
+
polygon,
|
|
294
|
+
polygons,
|
|
295
|
+
radiansToDegrees,
|
|
296
|
+
radiansToLength,
|
|
297
|
+
round,
|
|
298
|
+
validateBBox,
|
|
299
|
+
validateId
|
|
300
|
+
};
|
|
301
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n BBox,\n Feature,\n FeatureCollection,\n Geometry,\n GeometryCollection,\n GeometryObject,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n Position,\n GeoJsonProperties,\n} from \"geojson\";\n\nimport { Id } from \"./lib/geojson.js\";\nexport * from \"./lib/geojson.js\";\n\n// TurfJS Combined Types\nexport type Coord = Feature<Point> | Point | Position;\n\n// TurfJS String Types\nexport type Units =\n | \"meters\"\n | \"metres\"\n | \"millimeters\"\n | \"millimetres\"\n | \"centimeters\"\n | \"centimetres\"\n | \"kilometers\"\n | \"kilometres\"\n | \"miles\"\n | \"nauticalmiles\"\n | \"inches\"\n | \"yards\"\n | \"feet\"\n | \"radians\"\n | \"degrees\";\nexport type AreaUnits =\n | Exclude<Units, \"radians\" | \"degrees\">\n | \"acres\"\n | \"hectares\";\nexport type Grid = \"point\" | \"square\" | \"hex\" | \"triangle\";\nexport type Corners = \"sw\" | \"se\" | \"nw\" | \"ne\" | \"center\" | \"centroid\";\n\nexport type Lines = LineString | MultiLineString | Polygon | MultiPolygon;\nexport type AllGeoJSON =\n | Feature\n | FeatureCollection\n | Geometry\n | GeometryCollection;\n\n/**\n * @module helpers\n */\n\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nexport const earthRadius = 6371008.8;\n\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * Keys are the name of the unit, values are the number of that unit in a single radian\n *\n * @memberof helpers\n * @type {Object}\n */\nexport const factors: Record<Units, number> = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: 360 / (2 * Math.PI),\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1000,\n kilometres: earthRadius / 1000,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1000,\n millimetres: earthRadius * 1000,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius * 1.0936,\n};\n\n/**\n\n * Area of measurement factors based on 1 square meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nexport const areaFactors: Record<AreaUnits, number> = {\n acres: 0.000247105,\n centimeters: 10000,\n centimetres: 10000,\n feet: 10.763910417,\n hectares: 0.0001,\n inches: 1550.003100006,\n kilometers: 0.000001,\n kilometres: 0.000001,\n meters: 1,\n metres: 1,\n miles: 3.86e-7,\n nauticalmiles: 2.9155334959812285e-7,\n millimeters: 1000000,\n millimetres: 1000000,\n yards: 1.195990046,\n};\n\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nexport function feature<\n G extends GeometryObject = Geometry,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geom: G | null,\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<G, P> {\n const feat: any = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\n\n/**\n * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.\n * For GeometryCollection type use `helpers.geometryCollection`\n *\n * @name geometry\n * @param {string} type Geometry Type\n * @param {Array<any>} coordinates Coordinates\n * @param {Object} [options={}] Optional Parameters\n * @returns {Geometry} a GeoJSON Geometry\n * @example\n * var type = \"Point\";\n * var coordinates = [110, 50];\n * var geometry = turf.geometry(type, coordinates);\n * // => geometry\n */\nexport function geometry(\n type:\n | \"Point\"\n | \"LineString\"\n | \"Polygon\"\n | \"MultiPoint\"\n | \"MultiLineString\"\n | \"MultiPolygon\",\n coordinates: any[],\n _options: Record<string, never> = {}\n) {\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\n\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array<number>} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<Point>} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nexport function point<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position,\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<Point, P> {\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n\n const geom: Point = {\n type: \"Point\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.\n *\n * @name points\n * @param {Array<Array<number>>} coordinates an array of Points\n * @param {Object} [properties={}] Translate these properties to each Feature\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<Point>} Point Feature\n * @example\n * var points = turf.points([\n * [-75, 39],\n * [-80, 45],\n * [-78, 50]\n * ]);\n *\n * //=points\n */\nexport function points<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): FeatureCollection<Point, P> {\n return featureCollection(\n coordinates.map((coords) => {\n return point(coords, properties);\n }),\n options\n );\n}\n\n/**\n * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.\n *\n * @name polygon\n * @param {Array<Array<Array<number>>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<Polygon>} Polygon Feature\n * @example\n * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });\n *\n * //=polygon\n */\nexport function polygon<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[][],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<Polygon, P> {\n for (const ring of coordinates) {\n if (ring.length < 4) {\n throw new Error(\n \"Each LinearRing of a Polygon must have 4 or more Positions.\"\n );\n }\n\n if (ring[ring.length - 1].length !== ring[0].length) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n\n for (let j = 0; j < ring[ring.length - 1].length; j++) {\n // Check if first point of Polygon contains two numbers\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n const geom: Polygon = {\n type: \"Polygon\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.\n *\n * @name polygons\n * @param {Array<Array<Array<Array<number>>>>} coordinates an array of Polygon coordinates\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<Polygon>} Polygon FeatureCollection\n * @example\n * var polygons = turf.polygons([\n * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],\n * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],\n * ]);\n *\n * //=polygons\n */\nexport function polygons<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[][][],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): FeatureCollection<Polygon, P> {\n return featureCollection(\n coordinates.map((coords) => {\n return polygon(coords, properties);\n }),\n options\n );\n}\n\n/**\n * Creates a {@link LineString} {@link Feature} from an Array of Positions.\n *\n * @name lineString\n * @param {Array<Array<number>>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<LineString>} LineString Feature\n * @example\n * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});\n * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});\n *\n * //=linestring1\n * //=linestring2\n */\nexport function lineString<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<LineString, P> {\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n const geom: LineString = {\n type: \"LineString\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.\n *\n * @name lineStrings\n * @param {Array<Array<Array<number>>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<LineString>} LineString FeatureCollection\n * @example\n * var linestrings = turf.lineStrings([\n * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],\n * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]\n * ]);\n *\n * //=linestrings\n */\nexport function lineStrings<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[][],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): FeatureCollection<LineString, P> {\n return featureCollection(\n coordinates.map((coords) => {\n return lineString(coords, properties);\n }),\n options\n );\n}\n\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nexport function featureCollection<\n G extends GeometryObject = Geometry,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n features: Array<Feature<G, P>>,\n options: { bbox?: BBox; id?: Id } = {}\n): FeatureCollection<G, P> {\n const fc: any = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\n\n/**\n * Creates a {@link Feature<MultiLineString>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiLineString\n * @param {Array<Array<Array<number>>>} coordinates an array of LineStrings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiLineString>} a MultiLineString feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);\n *\n * //=multiLine\n */\nexport function multiLineString<\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n coordinates: Position[][],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<MultiLineString, P> {\n const geom: MultiLineString = {\n type: \"MultiLineString\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link Feature<MultiPoint>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPoint\n * @param {Array<Array<number>>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiPoint>} a MultiPoint feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPt = turf.multiPoint([[0,0],[10,10]]);\n *\n * //=multiPt\n */\nexport function multiPoint<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<MultiPoint, P> {\n const geom: MultiPoint = {\n type: \"MultiPoint\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link Feature<MultiPolygon>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPolygon\n * @param {Array<Array<Array<Array<number>>>>} coordinates an array of Polygons\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiPolygon>} a multipolygon feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);\n *\n * //=multiPoly\n *\n */\nexport function multiPolygon<P extends GeoJsonProperties = GeoJsonProperties>(\n coordinates: Position[][][],\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<MultiPolygon, P> {\n const geom: MultiPolygon = {\n type: \"MultiPolygon\",\n coordinates,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Creates a {@link Feature<GeometryCollection>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name geometryCollection\n * @param {Array<Geometry>} geometries an array of GeoJSON Geometries\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<GeometryCollection>} a GeoJSON GeometryCollection Feature\n * @example\n * var pt = turf.geometry(\"Point\", [100, 0]);\n * var line = turf.geometry(\"LineString\", [[101, 0], [102, 1]]);\n * var collection = turf.geometryCollection([pt, line]);\n *\n * // => collection\n */\nexport function geometryCollection<\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geometries: Array<\n Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon\n >,\n properties?: P,\n options: { bbox?: BBox; id?: Id } = {}\n): Feature<GeometryCollection, P> {\n const geom: GeometryCollection = {\n type: \"GeometryCollection\",\n geometries,\n };\n return feature(geom, properties, options);\n}\n\n/**\n * Round number to precision\n *\n * @param {number} num Number\n * @param {number} [precision=0] Precision\n * @returns {number} rounded number\n * @example\n * turf.round(120.4321)\n * //=120\n *\n * turf.round(120.4321, 2)\n * //=120.43\n */\nexport function round(num: number, precision = 0): number {\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n const multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\n\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nexport function radiansToLength(\n radians: number,\n units: Units = \"kilometers\"\n): number {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\n\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nexport function lengthToRadians(\n distance: number,\n units: Units = \"kilometers\"\n): number {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\n\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet\n *\n * @name lengthToDegrees\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} degrees\n */\nexport function lengthToDegrees(distance: number, units?: Units): number {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\n\n/**\n * Converts any bearing angle from the north line direction (positive clockwise)\n * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line\n *\n * @name bearingToAzimuth\n * @param {number} bearing angle, between -180 and +180 degrees\n * @returns {number} angle between 0 and 360 degrees\n */\nexport function bearingToAzimuth(bearing: number): number {\n let angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\n\n/**\n * Converts an angle in radians to degrees\n *\n * @name radiansToDegrees\n * @param {number} radians angle in radians\n * @returns {number} degrees between 0 and 360 degrees\n */\nexport function radiansToDegrees(radians: number): number {\n const degrees = radians % (2 * Math.PI);\n return (degrees * 180) / Math.PI;\n}\n\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nexport function degreesToRadians(degrees: number): number {\n const radians = degrees % 360;\n return (radians * Math.PI) / 180;\n}\n\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nexport function convertLength(\n length: number,\n originalUnit: Units = \"kilometers\",\n finalUnit: Units = \"kilometers\"\n): number {\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\n\n/**\n * Converts a area to the requested unit.\n * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares\n * @param {number} area to be converted\n * @param {Units} [originalUnit=\"meters\"] of the distance\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted area\n */\nexport function convertArea(\n area: number,\n originalUnit: AreaUnits = \"meters\",\n finalUnit: AreaUnits = \"kilometers\"\n): number {\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n\n const startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n\n const finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n\n return (area / startFactor) * finalFactor;\n}\n\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nexport function isNumber(num: any): boolean {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\n\n/**\n * isObject\n *\n * @param {*} input variable to validate\n * @returns {boolean} true/false, including false for Arrays and Functions\n * @example\n * turf.isObject({elevation: 10})\n * //=true\n * turf.isObject('foo')\n * //=false\n */\nexport function isObject(input: any): boolean {\n return input !== null && typeof input === \"object\" && !Array.isArray(input);\n}\n\n/**\n * Validate BBox\n *\n * @private\n * @param {Array<number>} bbox BBox to validate\n * @returns {void}\n * @throws {Error} if BBox is not valid\n * @example\n * validateBBox([-180, -40, 110, 50])\n * //=OK\n * validateBBox([-180, -40])\n * //=Error\n * validateBBox('Foo')\n * //=Error\n * validateBBox(5)\n * //=Error\n * validateBBox(null)\n * //=Error\n * validateBBox(undefined)\n * //=Error\n */\nexport function validateBBox(bbox: any): void {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach((num) => {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\n\n/**\n * Validate Id\n *\n * @private\n * @param {string|number} id Id to validate\n * @returns {void}\n * @throws {Error} if Id is not valid\n * @example\n * validateId([-180, -40, 110, 50])\n * //=Error\n * validateId([-180, -40])\n * //=Error\n * validateId('Foo')\n * //=OK\n * validateId(5)\n * //=OK\n * validateId(null)\n * //=Error\n * validateId(undefined)\n * //=Error\n */\nexport function validateId(id: any): void {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\n"],"mappings":";AAgEO,IAAM,cAAc;AAUpB,IAAM,UAAiC;AAAA,EAC5C,aAAa,cAAc;AAAA,EAC3B,aAAa,cAAc;AAAA,EAC3B,SAAS,OAAO,IAAI,KAAK;AAAA,EACzB,MAAM,cAAc;AAAA,EACpB,QAAQ,cAAc;AAAA,EACtB,YAAY,cAAc;AAAA,EAC1B,YAAY,cAA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