@turf/helpers 7.1.0-alpha.70 → 7.2.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 CHANGED
@@ -4,38 +4,82 @@
4
4
 
5
5
  ## helpers
6
6
 
7
- ### earthRadius
7
+ ## Units
8
8
 
9
- The Earth radius in kilometers. Used by Turf modules that model the Earth as a sphere. The [mean radius][1] was selected because it is [recommended ][2] by the Haversine formula (used by turf/distance) to reduce error.
9
+ Linear measurement units.
10
10
 
11
- Type: [number][3]
11
+ ⚠️ Warning. Be aware of the implications of using radian or degree units to
12
+ measure distance. The distance represented by a degree of longitude *varies*
13
+ depending on latitude.
12
14
 
13
- ### factors
15
+ See [https://www.thoughtco.com/degree-of-latitude-and-longitude-distance-4070616][1]
16
+ for an illustration of this behaviour.
17
+
18
+ Type: (`"meters"` | `"metres"` | `"millimeters"` | `"millimetres"` | `"centimeters"` | `"centimetres"` | `"kilometers"` | `"kilometres"` | `"miles"` | `"nauticalmiles"` | `"inches"` | `"yards"` | `"feet"` | `"radians"` | `"degrees"`)
19
+
20
+ ## AreaUnits
21
+
22
+ Area measurement units.
23
+
24
+ Type: (Exclude<[Units][2], (`"radians"` | `"degrees"`)> | `"acres"` | `"hectares"`)
25
+
26
+ ## Grid
27
+
28
+ Grid types.
29
+
30
+ Type: (`"point"` | `"square"` | `"hex"` | `"triangle"`)
31
+
32
+ ## Corners
33
+
34
+ Shorthand corner identifiers.
35
+
36
+ Type: (`"sw"` | `"se"` | `"nw"` | `"ne"` | `"center"` | `"centroid"`)
37
+
38
+ ## Lines
39
+
40
+ Geometries made up of lines i.e. lines and polygons.
41
+
42
+ Type: ([LineString][3] | [MultiLineString][4] | [Polygon][5] | [MultiPolygon][6])
43
+
44
+ ## AllGeoJSON
45
+
46
+ Convenience type for all possible GeoJSON.
47
+
48
+ Type: ([Feature][7] | [FeatureCollection][8] | [Geometry][9] | [GeometryCollection][10])
49
+
50
+ ## earthRadius
51
+
52
+ The Earth radius in kilometers. Used by Turf modules that model the Earth as a sphere. The [mean radius][11] was selected because it is [recommended ][12] by the Haversine formula (used by turf/distance) to reduce error.
53
+
54
+ Type: [number][13]
55
+
56
+ ## factors
14
57
 
15
58
  Unit of measurement factors based on earthRadius.
16
59
 
17
60
  Keys are the name of the unit, values are the number of that unit in a single radian
18
61
 
19
- Type: [Object][4]
62
+ Type: Record<[Units][2], [number][13]>
20
63
 
21
- ### areaFactors
64
+ ## areaFactors
22
65
 
23
66
  Area of measurement factors based on 1 square meter.
24
67
 
25
- Type: [Object][4]
68
+ Type: Record<[AreaUnits][14], [number][13]>
26
69
 
27
70
  ## feature
28
71
 
29
- Wraps a GeoJSON [Geometry][5] in a GeoJSON [Feature][6].
72
+ Wraps a GeoJSON [Geometry][9] in a GeoJSON [Feature][7].
30
73
 
31
74
  ### Parameters
32
75
 
33
- * `geometry` **[Geometry][5]** input geometry
34
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
35
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
76
+ * `geom` **(G | null)**&#x20;
77
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
78
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
36
79
 
37
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
38
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
80
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
81
+ * `options.id` **Id?** Identifier associated with the Feature
82
+ * `geometry` **[GeometryObject][9]** input geometry
39
83
 
40
84
  ### Examples
41
85
 
@@ -50,18 +94,19 @@ var feature = turf.feature(geometry);
50
94
  //=feature
51
95
  ```
52
96
 
53
- Returns **[Feature][6]** a GeoJSON Feature
97
+ Returns **[Feature][7]<[GeometryObject][9], [GeoJsonProperties][7]>** a GeoJSON Feature
54
98
 
55
99
  ## geometry
56
100
 
57
- Creates a GeoJSON [Geometry][5] from a Geometry string type & coordinates.
101
+ Creates a GeoJSON [Geometry][9] from a Geometry string type & coordinates.
58
102
  For GeometryCollection type use `helpers.geometryCollection`
59
103
 
60
104
  ### Parameters
61
105
 
62
- * `type` **[string][8]** Geometry Type
63
- * `coordinates` **[Array][7]\<any>** Coordinates
64
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
106
+ * `type` **(`"Point"` | `"LineString"` | `"Polygon"` | `"MultiPoint"` | `"MultiLineString"` | `"MultiPolygon"`)** Geometry Type
107
+ * `coordinates` **[Array][17]\<any>** Coordinates
108
+ * `_options` **Record<[string][18], never>** (optional, default `{}`)
109
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
65
110
 
66
111
  ### Examples
67
112
 
@@ -72,20 +117,20 @@ var geometry = turf.geometry(type, coordinates);
72
117
  // => geometry
73
118
  ```
74
119
 
75
- Returns **[Geometry][5]** a GeoJSON Geometry
120
+ Returns **[Geometry][9]** a GeoJSON Geometry
76
121
 
77
122
  ## point
78
123
 
79
- Creates a [Point][9] [Feature][6] from a Position.
124
+ Creates a [Point][19] [Feature][7] from a Position.
80
125
 
81
126
  ### Parameters
82
127
 
83
- * `coordinates` **[Array][7]<[number][3]>** longitude, latitude position (each in decimal degrees)
84
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
85
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
128
+ * `coordinates` **[Position][20]** longitude, latitude position (each in decimal degrees)
129
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
130
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
86
131
 
87
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
88
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
132
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
133
+ * `options.id` **Id?** Identifier associated with the Feature
89
134
 
90
135
  ### Examples
91
136
 
@@ -95,21 +140,21 @@ var point = turf.point([-75.343, 39.984]);
95
140
  //=point
96
141
  ```
97
142
 
98
- Returns **[Feature][6]<[Point][9]>** a Point feature
143
+ Returns **[Feature][7]<[Point][19], [GeoJsonProperties][7]>** a Point feature
99
144
 
100
145
  ## points
101
146
 
102
- Creates a [Point][9] [FeatureCollection][10] from an Array of Point coordinates.
147
+ Creates a [Point][19] [FeatureCollection][8] from an Array of Point coordinates.
103
148
 
104
149
  ### Parameters
105
150
 
106
- * `coordinates` **[Array][7]<[Array][7]<[number][3]>>** an array of Points
107
- * `properties` **[Object][4]** Translate these properties to each Feature (optional, default `{}`)
108
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
151
+ * `coordinates` **[Array][17]<[Position][20]>** an array of Points
152
+ * `properties` **[GeoJsonProperties][7]** Translate these properties to each Feature (optional, default `{}`)
153
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
109
154
 
110
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north]
155
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north]
111
156
  associated with the FeatureCollection
112
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the FeatureCollection
157
+ * `options.id` **Id?** Identifier associated with the FeatureCollection
113
158
 
114
159
  ### Examples
115
160
 
@@ -123,20 +168,20 @@ var points = turf.points([
123
168
  //=points
124
169
  ```
125
170
 
126
- Returns **[FeatureCollection][10]<[Point][9]>** Point Feature
171
+ Returns **[FeatureCollection][8]<[Point][19]>** Point Feature
127
172
 
128
173
  ## polygon
129
174
 
130
- Creates a [Polygon][11] [Feature][6] from an Array of LinearRings.
175
+ Creates a [Polygon][5] [Feature][7] from an Array of LinearRings.
131
176
 
132
177
  ### Parameters
133
178
 
134
- * `coordinates` **[Array][7]<[Array][7]<[Array][7]<[number][3]>>>** an array of LinearRings
135
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
136
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
179
+ * `coordinates` **[Array][17]<[Array][17]<[Position][20]>>**&#x20;
180
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
181
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
137
182
 
138
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
139
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
183
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
184
+ * `options.id` **Id?** Identifier associated with the Feature
140
185
 
141
186
  ### Examples
142
187
 
@@ -146,20 +191,20 @@ var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],
146
191
  //=polygon
147
192
  ```
148
193
 
149
- Returns **[Feature][6]<[Polygon][11]>** Polygon Feature
194
+ Returns **[Feature][7]<[Polygon][5], [GeoJsonProperties][7]>** Polygon Feature
150
195
 
151
196
  ## polygons
152
197
 
153
- Creates a [Polygon][11] [FeatureCollection][10] from an Array of Polygon coordinates.
198
+ Creates a [Polygon][5] [FeatureCollection][8] from an Array of Polygon coordinates.
154
199
 
155
200
  ### Parameters
156
201
 
157
- * `coordinates` **[Array][7]<[Array][7]<[Array][7]<[Array][7]<[number][3]>>>>** an array of Polygon coordinates
158
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
159
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
202
+ * `coordinates` **[Array][17]<[Array][17]<[Array][17]<[Position][20]>>>**&#x20;
203
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
204
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
160
205
 
161
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
162
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the FeatureCollection
206
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
207
+ * `options.id` **Id?** Identifier associated with the FeatureCollection
163
208
 
164
209
  ### Examples
165
210
 
@@ -172,20 +217,20 @@ var polygons = turf.polygons([
172
217
  //=polygons
173
218
  ```
174
219
 
175
- Returns **[FeatureCollection][10]<[Polygon][11]>** Polygon FeatureCollection
220
+ Returns **[FeatureCollection][8]<[Polygon][5], [GeoJsonProperties][7]>** Polygon FeatureCollection
176
221
 
177
222
  ## lineString
178
223
 
179
- Creates a [LineString][12] [Feature][6] from an Array of Positions.
224
+ Creates a [LineString][3] [Feature][7] from an Array of Positions.
180
225
 
181
226
  ### Parameters
182
227
 
183
- * `coordinates` **[Array][7]<[Array][7]<[number][3]>>** an array of Positions
184
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
185
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
228
+ * `coordinates` **[Array][17]<[Position][20]>** an array of Positions
229
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
230
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
186
231
 
187
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
188
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
232
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
233
+ * `options.id` **Id?** Identifier associated with the Feature
189
234
 
190
235
  ### Examples
191
236
 
@@ -197,21 +242,21 @@ var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]],
197
242
  //=linestring2
198
243
  ```
199
244
 
200
- Returns **[Feature][6]<[LineString][12]>** LineString Feature
245
+ Returns **[Feature][7]<[LineString][3], [GeoJsonProperties][7]>** LineString Feature
201
246
 
202
247
  ## lineStrings
203
248
 
204
- Creates a [LineString][12] [FeatureCollection][10] from an Array of LineString coordinates.
249
+ Creates a [LineString][3] [FeatureCollection][8] from an Array of LineString coordinates.
205
250
 
206
251
  ### Parameters
207
252
 
208
- * `coordinates` **[Array][7]<[Array][7]<[Array][7]<[number][3]>>>** an array of LinearRings
209
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
210
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
253
+ * `coordinates` **[Array][17]<[Array][17]<[Position][20]>>**&#x20;
254
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
255
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
211
256
 
212
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north]
257
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north]
213
258
  associated with the FeatureCollection
214
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the FeatureCollection
259
+ * `options.id` **Id?** Identifier associated with the FeatureCollection
215
260
 
216
261
  ### Examples
217
262
 
@@ -224,19 +269,19 @@ var linestrings = turf.lineStrings([
224
269
  //=linestrings
225
270
  ```
226
271
 
227
- Returns **[FeatureCollection][10]<[LineString][12]>** LineString FeatureCollection
272
+ Returns **[FeatureCollection][8]<[LineString][3], [GeoJsonProperties][7]>** LineString FeatureCollection
228
273
 
229
274
  ## featureCollection
230
275
 
231
- Takes one or more [Features][6] and creates a [FeatureCollection][10].
276
+ Takes one or more [Features][7] and creates a [FeatureCollection][8].
232
277
 
233
278
  ### Parameters
234
279
 
235
- * `features` **[Array][7]<[Feature][6]>** input features
236
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
280
+ * `features` **[Array][17]<[Feature][7]<[GeometryObject][9], [GeoJsonProperties][7]>>** input features
281
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
237
282
 
238
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
239
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
283
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
284
+ * `options.id` **Id?** Identifier associated with the Feature
240
285
 
241
286
  ### Examples
242
287
 
@@ -254,21 +299,21 @@ var collection = turf.featureCollection([
254
299
  //=collection
255
300
  ```
256
301
 
257
- Returns **[FeatureCollection][10]** FeatureCollection of Features
302
+ Returns **[FeatureCollection][8]<[GeometryObject][9], [GeoJsonProperties][7]>** FeatureCollection of Features
258
303
 
259
304
  ## multiLineString
260
305
 
261
- Creates a [Feature\<MultiLineString>][13] based on a
306
+ Creates a [Feature][7]<[MultiLineString][4]> based on a
262
307
  coordinate array. Properties can be added optionally.
263
308
 
264
309
  ### Parameters
265
310
 
266
- * `coordinates` **[Array][7]<[Array][7]<[Array][7]<[number][3]>>>** an array of LineStrings
267
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
268
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
311
+ * `coordinates` **[Array][17]<[Array][17]<[Position][20]>>**&#x20;
312
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
313
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
269
314
 
270
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
271
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
315
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
316
+ * `options.id` **Id?** Identifier associated with the Feature
272
317
 
273
318
  ### Examples
274
319
 
@@ -278,23 +323,23 @@ var multiLine = turf.multiLineString([[[0,0],[10,10]]]);
278
323
  //=multiLine
279
324
  ```
280
325
 
281
- * Throws **[Error][14]** if no coordinates are passed
326
+ * Throws **[Error][21]** if no coordinates are passed
282
327
 
283
- Returns **[Feature][6]<[MultiLineString][15]>** a MultiLineString feature
328
+ Returns **[Feature][7]<[MultiLineString][4], [GeoJsonProperties][7]>** a MultiLineString feature
284
329
 
285
330
  ## multiPoint
286
331
 
287
- Creates a [Feature\<MultiPoint>][16] based on a
332
+ Creates a [Feature][7]<[MultiPoint][22]> based on a
288
333
  coordinate array. Properties can be added optionally.
289
334
 
290
335
  ### Parameters
291
336
 
292
- * `coordinates` **[Array][7]<[Array][7]<[number][3]>>** an array of Positions
293
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
294
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
337
+ * `coordinates` **[Array][17]<[Position][20]>** an array of Positions
338
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
339
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
295
340
 
296
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
297
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
341
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
342
+ * `options.id` **Id?** Identifier associated with the Feature
298
343
 
299
344
  ### Examples
300
345
 
@@ -304,23 +349,23 @@ var multiPt = turf.multiPoint([[0,0],[10,10]]);
304
349
  //=multiPt
305
350
  ```
306
351
 
307
- * Throws **[Error][14]** if no coordinates are passed
352
+ * Throws **[Error][21]** if no coordinates are passed
308
353
 
309
- Returns **[Feature][6]<[MultiPoint][17]>** a MultiPoint feature
354
+ Returns **[Feature][7]<[MultiPoint][22], [GeoJsonProperties][7]>** a MultiPoint feature
310
355
 
311
356
  ## multiPolygon
312
357
 
313
- Creates a [Feature\<MultiPolygon>][18] based on a
358
+ Creates a [Feature][7]<[MultiPolygon][6]> based on a
314
359
  coordinate array. Properties can be added optionally.
315
360
 
316
361
  ### Parameters
317
362
 
318
- * `coordinates` **[Array][7]<[Array][7]<[Array][7]<[Array][7]<[number][3]>>>>** an array of Polygons
319
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
320
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
363
+ * `coordinates` **[Array][17]<[Array][17]<[Array][17]<[Position][20]>>>**&#x20;
364
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
365
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
321
366
 
322
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
323
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
367
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
368
+ * `options.id` **Id?** Identifier associated with the Feature
324
369
 
325
370
  ### Examples
326
371
 
@@ -330,23 +375,23 @@ var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);
330
375
  //=multiPoly
331
376
  ```
332
377
 
333
- * Throws **[Error][14]** if no coordinates are passed
378
+ * Throws **[Error][21]** if no coordinates are passed
334
379
 
335
- Returns **[Feature][6]<[MultiPolygon][19]>** a multipolygon feature
380
+ Returns **[Feature][7]<[MultiPolygon][6], [GeoJsonProperties][7]>** a multipolygon feature
336
381
 
337
382
  ## geometryCollection
338
383
 
339
- Creates a [Feature\<GeometryCollection>][20] based on a
384
+ Creates a Feature<GeometryCollection> based on a
340
385
  coordinate array. Properties can be added optionally.
341
386
 
342
387
  ### Parameters
343
388
 
344
- * `geometries` **[Array][7]<[Geometry][5]>** an array of GeoJSON Geometries
345
- * `properties` **[Object][4]** an Object of key-value pairs to add as properties (optional, default `{}`)
346
- * `options` **[Object][4]** Optional Parameters (optional, default `{}`)
389
+ * `geometries` **[Array][17]<([Point][19] | [LineString][3] | [Polygon][5] | [MultiPoint][22] | [MultiLineString][4] | [MultiPolygon][6])>** an array of GeoJSON Geometries
390
+ * `properties` **[GeoJsonProperties][7]** an Object of key-value pairs to add as properties (optional, default `{}`)
391
+ * `options` **[Object][15]** Optional Parameters (optional, default `{}`)
347
392
 
348
- * `options.bbox` **[Array][7]<[number][3]>?** Bounding Box Array \[west, south, east, north] associated with the Feature
349
- * `options.id` **([string][8] | [number][3])?** Identifier associated with the Feature
393
+ * `options.bbox` **[BBox][16]?** Bounding Box Array \[west, south, east, north] associated with the Feature
394
+ * `options.id` **Id?** Identifier associated with the Feature
350
395
 
351
396
  ### Examples
352
397
 
@@ -358,7 +403,7 @@ var collection = turf.geometryCollection([pt, line]);
358
403
  // => collection
359
404
  ```
360
405
 
361
- Returns **[Feature][6]<[GeometryCollection][21]>** a GeoJSON GeometryCollection Feature
406
+ Returns **[Feature][7]<[GeometryCollection][10], [GeoJsonProperties][7]>** a GeoJSON GeometryCollection Feature
362
407
 
363
408
  ## round
364
409
 
@@ -366,8 +411,8 @@ Round number to precision
366
411
 
367
412
  ### Parameters
368
413
 
369
- * `num` **[number][3]** Number
370
- * `precision` **[number][3]** Precision (optional, default `0`)
414
+ * `num` **[number][13]** Number
415
+ * `precision` **[number][13]** Precision (optional, default `0`)
371
416
 
372
417
  ### Examples
373
418
 
@@ -379,7 +424,7 @@ turf.round(120.4321, 2)
379
424
  //=120.43
380
425
  ```
381
426
 
382
- Returns **[number][3]** rounded number
427
+ Returns **[number][13]** rounded number
383
428
 
384
429
  ## radiansToLength
385
430
 
@@ -388,11 +433,11 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, ce
388
433
 
389
434
  ### Parameters
390
435
 
391
- * `radians` **[number][3]** in radians across the sphere
392
- * `units` **[string][8]** can be degrees, radians, miles, inches, yards, metres,
436
+ * `radians` **[number][13]** in radians across the sphere
437
+ * `units` **[Units][2]** can be degrees, radians, miles, inches, yards, metres,
393
438
  meters, kilometres, kilometers. (optional, default `"kilometers"`)
394
439
 
395
- Returns **[number][3]** distance
440
+ Returns **[number][13]** distance
396
441
 
397
442
  ## lengthToRadians
398
443
 
@@ -401,11 +446,11 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, ce
401
446
 
402
447
  ### Parameters
403
448
 
404
- * `distance` **[number][3]** in real units
405
- * `units` **[string][8]** can be degrees, radians, miles, inches, yards, metres,
449
+ * `distance` **[number][13]** in real units
450
+ * `units` **[Units][2]** can be degrees, radians, miles, inches, yards, metres,
406
451
  meters, kilometres, kilometers. (optional, default `"kilometers"`)
407
452
 
408
- Returns **[number][3]** radians
453
+ Returns **[number][13]** radians
409
454
 
410
455
  ## lengthToDegrees
411
456
 
@@ -414,11 +459,11 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, k
414
459
 
415
460
  ### Parameters
416
461
 
417
- * `distance` **[number][3]** in real units
418
- * `units` **[string][8]** can be degrees, radians, miles, inches, yards, metres,
462
+ * `distance` **[number][13]** in real units
463
+ * `units` **[Units][2]** can be degrees, radians, miles, inches, yards, metres,
419
464
  meters, kilometres, kilometers. (optional, default `"kilometers"`)
420
465
 
421
- Returns **[number][3]** degrees
466
+ Returns **[number][13]** degrees
422
467
 
423
468
  ## bearingToAzimuth
424
469
 
@@ -427,9 +472,9 @@ and returns an angle between 0-360 degrees (positive clockwise), 0 being the nor
427
472
 
428
473
  ### Parameters
429
474
 
430
- * `bearing` **[number][3]** angle, between -180 and +180 degrees
475
+ * `bearing` **[number][13]** angle, between -180 and +180 degrees
431
476
 
432
- Returns **[number][3]** angle between 0 and 360 degrees
477
+ Returns **[number][13]** angle between 0 and 360 degrees
433
478
 
434
479
  ## azimuthToBearing
435
480
 
@@ -438,9 +483,9 @@ and returns an angle between -180 and +180 degrees (positive clockwise), 0 being
438
483
 
439
484
  ### Parameters
440
485
 
441
- * `angle` **[number][3]** between 0 and 360 degrees
486
+ * `angle` **[number][13]** between 0 and 360 degrees
442
487
 
443
- Returns **[number][3]** bearing between -180 and +180 degrees
488
+ Returns **[number][13]** bearing between -180 and +180 degrees
444
489
 
445
490
  ## radiansToDegrees
446
491
 
@@ -448,9 +493,9 @@ Converts an angle in radians to degrees
448
493
 
449
494
  ### Parameters
450
495
 
451
- * `radians` **[number][3]** angle in radians
496
+ * `radians` **[number][13]** angle in radians
452
497
 
453
- Returns **[number][3]** degrees between 0 and 360 degrees
498
+ Returns **[number][13]** degrees between 0 and 360 degrees
454
499
 
455
500
  ## degreesToRadians
456
501
 
@@ -458,35 +503,33 @@ Converts an angle in degrees to radians
458
503
 
459
504
  ### Parameters
460
505
 
461
- * `degrees` **[number][3]** angle between 0 and 360 degrees
506
+ * `degrees` **[number][13]** angle between 0 and 360 degrees
462
507
 
463
- Returns **[number][3]** angle in radians
508
+ Returns **[number][13]** angle in radians
464
509
 
465
510
  ## convertLength
466
511
 
467
- Converts a length to the requested unit.
468
- Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
512
+ Converts a length from one unit to another.
469
513
 
470
514
  ### Parameters
471
515
 
472
- * `length` **[number][3]** to be converted
473
- * `originalUnit` **Units** of the length (optional, default `"kilometers"`)
474
- * `finalUnit` **Units** returned unit (optional, default `"kilometers"`)
516
+ * `length` **[number][13]** Length to be converted
517
+ * `originalUnit` **[Units][2]** Input length unit (optional, default `"kilometers"`)
518
+ * `finalUnit` **[Units][2]** Returned length unit (optional, default `"kilometers"`)
475
519
 
476
- Returns **[number][3]** the converted length
520
+ Returns **[number][13]** The converted length
477
521
 
478
522
  ## convertArea
479
523
 
480
- Converts a area to the requested unit.
481
- Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares
524
+ Converts an area from one unit to another.
482
525
 
483
526
  ### Parameters
484
527
 
485
- * `area` **[number][3]** to be converted
486
- * `originalUnit` **Units** of the distance (optional, default `"meters"`)
487
- * `finalUnit` **Units** returned unit (optional, default `"kilometers"`)
528
+ * `area` **[number][13]** Area to be converted
529
+ * `originalUnit` **[AreaUnits][14]** Input area unit (optional, default `"meters"`)
530
+ * `finalUnit` **[AreaUnits][14]** Returned area unit (optional, default `"kilometers"`)
488
531
 
489
- Returns **[number][3]** the converted area
532
+ Returns **[number][13]** The converted length
490
533
 
491
534
  ## isNumber
492
535
 
@@ -505,7 +548,7 @@ turf.isNumber('foo')
505
548
  //=false
506
549
  ```
507
550
 
508
- Returns **[boolean][22]** true/false
551
+ Returns **[boolean][23]** true/false
509
552
 
510
553
  ## isObject
511
554
 
@@ -524,51 +567,53 @@ turf.isObject('foo')
524
567
  //=false
525
568
  ```
526
569
 
527
- Returns **[boolean][22]** true/false, including false for Arrays and Functions
570
+ Returns **[boolean][23]** true/false, including false for Arrays and Functions
571
+
572
+ [1]: https://www.thoughtco.com/degree-of-latitude-and-longitude-distance-4070616
528
573
 
529
- [1]: https://en.wikipedia.org/wiki/Earth_radius#Arithmetic_mean_radius
574
+ [2]: #units
530
575
 
531
- [2]: https://rosettacode.org/wiki/Haversine_formula#:~:text=This%20value%20is%20recommended
576
+ [3]: https://tools.ietf.org/html/rfc7946#section-3.1.4
532
577
 
533
- [3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
578
+ [4]: https://tools.ietf.org/html/rfc7946#section-3.1.5
534
579
 
535
- [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
580
+ [5]: https://tools.ietf.org/html/rfc7946#section-3.1.6
536
581
 
537
- [5]: https://tools.ietf.org/html/rfc7946#section-3.1
582
+ [6]: https://tools.ietf.org/html/rfc7946#section-3.1.7
538
583
 
539
- [6]: https://tools.ietf.org/html/rfc7946#section-3.2
584
+ [7]: https://tools.ietf.org/html/rfc7946#section-3.2
540
585
 
541
- [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
586
+ [8]: https://tools.ietf.org/html/rfc7946#section-3.3
542
587
 
543
- [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
588
+ [9]: https://tools.ietf.org/html/rfc7946#section-3.1
544
589
 
545
- [9]: https://tools.ietf.org/html/rfc7946#section-3.1.2
590
+ [10]: https://tools.ietf.org/html/rfc7946#section-3.1.8
546
591
 
547
- [10]: https://tools.ietf.org/html/rfc7946#section-3.3
592
+ [11]: https://en.wikipedia.org/wiki/Earth_radius#Arithmetic_mean_radius
548
593
 
549
- [11]: https://tools.ietf.org/html/rfc7946#section-3.1.6
594
+ [12]: https://rosettacode.org/wiki/Haversine_formula#:~:text=This%20value%20is%20recommended
550
595
 
551
- [12]: https://tools.ietf.org/html/rfc7946#section-3.1.4
596
+ [13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
552
597
 
553
- [13]: Feature<MultiLineString>
598
+ [14]: #areaunits
554
599
 
555
- [14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
600
+ [15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
556
601
 
557
- [15]: https://tools.ietf.org/html/rfc7946#section-3.1.5
602
+ [16]: https://tools.ietf.org/html/rfc7946#section-5
558
603
 
559
- [16]: Feature<MultiPoint>
604
+ [17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
560
605
 
561
- [17]: https://tools.ietf.org/html/rfc7946#section-3.1.3
606
+ [18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
562
607
 
563
- [18]: Feature<MultiPolygon>
608
+ [19]: https://tools.ietf.org/html/rfc7946#section-3.1.2
564
609
 
565
- [19]: https://tools.ietf.org/html/rfc7946#section-3.1.7
610
+ [20]: https://developer.mozilla.org/docs/Web/API/Position
566
611
 
567
- [20]: Feature<GeometryCollection>
612
+ [21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
568
613
 
569
- [21]: https://tools.ietf.org/html/rfc7946#section-3.1.8
614
+ [22]: https://tools.ietf.org/html/rfc7946#section-3.1.3
570
615
 
571
- [22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
616
+ [23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
572
617
 
573
618
  <!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->
574
619