Skip to content

Commit 7501c18

Browse files
committed
Makes units link to website docs.
1 parent 95e46b6 commit 7501c18

File tree

50 files changed

+115
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+115
-106
lines changed

packages/turf-along/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Takes a [LineString][1] and returns a [Point][2] at a specified distance along t
1212
* `distance` **[number][4]** distance along the line
1313
* `options` **[Object][5]?** Optional parameters (optional, default `{}`)
1414

15-
* `options.units` **Units** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`)
15+
* `options.units` **Units** Supports all valid Turf [Units][6]. (optional, default `"kilometers"`)
1616

1717
### Examples
1818

@@ -38,6 +38,8 @@ Returns **[Feature][3]<[Point][2]>** Point `distance` `units` along the line
3838

3939
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
4040

41+
[6]: https://turfjs.org/docs/api/types/Units
42+
4143
<!-- 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. -->
4244

4345
---

packages/turf-along/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getGeom } from "@turf/invariant";
1212
* @param {Feature<LineString>|LineString} line input line
1313
* @param {number} distance distance along the line
1414
* @param {Object} [options] Optional parameters
15-
* @param {Units} [options.units="kilometers"] can be degrees, radians, miles, or kilometers
15+
* @param {Units} [options.units="kilometers"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.
1616
* @returns {Feature<Point>} Point `distance` `units` along the line
1717
* @example
1818
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);

packages/turf-buffer/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## buffer
66

7-
Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.
7+
Calculates a buffer for input features for a given radius.
88

99
When using a negative radius, the resulting geometry may be invalid if
1010
it's too small compared to the radius magnitude. If the input is a
@@ -18,7 +18,7 @@ the input, or even be empty.
1818
* `radius` **[number][4]** distance to draw the buffer (negative values are allowed)
1919
* `options` **[Object][5]** Optional parameters (optional, default `{}`)
2020

21-
* `options.units` **[string][6]** any of the options supported by turf units (optional, default `"kilometers"`)
21+
* `options.units` **Units** Supports all valid Turf [Units][6]. (optional, default `"kilometers"`)
2222
* `options.steps` **[number][4]** number of steps (optional, default `8`)
2323

2424
### Examples
@@ -43,7 +43,7 @@ Returns **([FeatureCollection][1] | [Feature][3]<([Polygon][7] | [MultiPolygon][
4343

4444
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
4545

46-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
46+
[6]: https://turfjs.org/docs/api/types/Units
4747

4848
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6
4949

packages/turf-buffer/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
const { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;
1414

1515
/**
16-
* Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.
16+
* Calculates a buffer for input features for a given radius.
1717
*
1818
* When using a negative radius, the resulting geometry may be invalid if
1919
* it's too small compared to the radius magnitude. If the input is a
@@ -25,7 +25,7 @@ const { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;
2525
* @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered
2626
* @param {number} radius distance to draw the buffer (negative values are allowed)
2727
* @param {Object} [options={}] Optional parameters
28-
* @param {string} [options.units="kilometers"] any of the options supported by turf units
28+
* @param {Units} [options.units="kilometers"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.
2929
* @param {number} [options.steps=8] number of steps
3030
* @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features
3131
* @example
@@ -80,7 +80,7 @@ function buffer(geojson, radius, options) {
8080
* @private
8181
* @param {Feature<any>} geojson input to be buffered
8282
* @param {number} radius distance to draw the buffer
83-
* @param {string} [units='kilometers'] any of the options supported by turf units
83+
* @param {Units} [units='kilometers'] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.
8484
* @param {number} [steps=8] number of steps
8585
* @returns {Feature<Polygon|MultiPolygon>} buffered feature
8686
*/

packages/turf-circle/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
## circle
66

7-
Takes a [Point][1] and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.
7+
Takes a [Point][1] and calculates the circle polygon given a radius in [Units][2]; and steps for precision.
88

99
### Parameters
1010

11-
* `center` **([Feature][2]<[Point][1]> | [Array][3]<[number][4]>)** center point
12-
* `radius` **[number][4]** radius of the circle
13-
* `options` **[Object][5]** Optional parameters (optional, default `{}`)
11+
* `center` **([Feature][3]<[Point][1]> | [Array][4]<[number][5]>)** center point
12+
* `radius` **[number][5]** radius of the circle
13+
* `options` **[Object][6]** Optional parameters (optional, default `{}`)
1414

15-
* `options.steps` **[number][4]** number of steps (optional, default `64`)
16-
* `options.units` **[string][6]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`)
17-
* `options.properties` **[Object][5]** properties (optional, default `{}`)
15+
* `options.steps` **[number][5]** number of steps (optional, default `64`)
16+
* `options.units` **Units** Supports all valid Turf [Units][2] (optional, default `'kilometers'`)
17+
* `options.properties` **[Object][6]** properties (optional, default `{}`)
1818

1919
### Examples
2020

@@ -28,19 +28,19 @@ var circle = turf.circle(center, radius, options);
2828
var addToMap = [turf.point(center), circle]
2929
```
3030

31-
Returns **[Feature][2]<[Polygon][7]>** circle polygon
31+
Returns **[Feature][3]<[Polygon][7]>** circle polygon
3232

3333
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
3434

35-
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
35+
[2]: https://turfjs.org/docs/api/types/Units
3636

37-
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
37+
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
3838

39-
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
39+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
4040

41-
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
41+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
4242

43-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
43+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
4444

4545
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6
4646

packages/turf-circle/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { destination } from "@turf/destination";
33
import { polygon, Units } from "@turf/helpers";
44

55
/**
6-
* Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.
6+
* Takes a {@link Point} and calculates the circle polygon given a radius in {@link https://turfjs.org/docs/api/types/Units Units}; and steps for precision.
77
*
88
* @function
99
* @param {Feature<Point>|number[]} center center point
1010
* @param {number} radius radius of the circle
1111
* @param {Object} [options={}] Optional parameters
1212
* @param {number} [options.steps=64] number of steps
13-
* @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians
13+
* @param {Units} [options.units='kilometers'] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
1414
* @param {Object} [options.properties={}] properties
1515
* @returns {Feature<Polygon>} circle polygon
1616
* @example

packages/turf-clusters-dbscan/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Takes a set of [points][4] and partition them into clusters according to [DBSCAN
3131
* `maxDistance` **[number][3]** Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
3232
* `options` **[Object][1]** Optional parameters (optional, default `{}`)
3333

34-
* `options.units` **[string][7]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`)
34+
* `options.units` **Units** in which `maxDistance` is expressed, Supports all valid Turf [Units][7] (optional, default `"kilometers"`)
3535
* `options.mutate` **[boolean][8]** Allows GeoJSON input to be mutated (optional, default `false`)
3636
* `options.minPoints` **[number][3]** Minimum number of points to generate a single cluster,
3737
points which do not meet this requirement will be classified as an 'edge' or 'noise'. (optional, default `3`)
@@ -63,7 +63,7 @@ Returns **[FeatureCollection][6]<[Point][4], [DbscanProps][9]>** Clustered Point
6363

6464
[6]: https://tools.ietf.org/html/rfc7946#section-3.3
6565

66-
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
66+
[7]: https://turfjs.org/docs/api/types/Units
6767

6868
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
6969

packages/turf-clusters-dbscan/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type IndexedPoint = {
4040
* @param {FeatureCollection<Point>} points to be clustered
4141
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
4242
* @param {Object} [options={}] Optional parameters
43-
* @param {string} [options.units="kilometers"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers
43+
* @param {Units} [options.units="kilometers"] in which `maxDistance` is expressed, Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
4444
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
4545
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
4646
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.

packages/turf-concave/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Internally, this uses [turf-tin][2] to generate geometries.
1414

1515
* `options.maxEdge` **[number][5]** the length (in 'units') of an edge necessary for part of the
1616
hull to become concave. (optional, default `Infinity`)
17-
* `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
17+
* `options.units` **Units** Supports all valid Turf [Units][6]. (optional, default `'kilometers'`)
1818

1919
### Examples
2020

@@ -47,7 +47,7 @@ Returns **([Feature][7]<([Polygon][8] | [MultiPolygon][9])> | null)** a concave
4747

4848
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
4949

50-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
50+
[6]: https://turfjs.org/docs/api/types/Units
5151

5252
[7]: https://tools.ietf.org/html/rfc7946#section-3.2
5353

packages/turf-concave/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { dissolve } from "./lib/turf-dissolve.js";
2121
* @param {Object} [options={}] Optional parameters
2222
* @param {number} [options.maxEdge=Infinity] the length (in 'units') of an edge necessary for part of the
2323
* hull to become concave.
24-
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
24+
* @param {Units} [options.units='kilometers'] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.
2525
* @returns {Feature<(Polygon|MultiPolygon)>|null} a concave hull (null value is returned if unable to compute hull)
2626
* @example
2727
* var points = turf.featureCollection([

0 commit comments

Comments
 (0)