From 9d788e0fd2e7267319de1eadc3d7536c4a452cc2 Mon Sep 17 00:00:00 2001 From: Mosly Date: Mon, 17 Jun 2024 15:00:19 +0000 Subject: [PATCH] chore: update cluster-dbscan docs --- packages/turf-clusters-dbscan/README.md | 2 +- packages/turf-clusters-dbscan/index.ts | 2 +- packages/turf-distance/README.md | 22 ++++++++++------------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/turf-clusters-dbscan/README.md b/packages/turf-clusters-dbscan/README.md index a00e5c620c..b84782bc8e 100644 --- a/packages/turf-clusters-dbscan/README.md +++ b/packages/turf-clusters-dbscan/README.md @@ -9,7 +9,7 @@ Takes a set of [points][1] and partition them into clusters according to [https: ### Parameters * `points` **[FeatureCollection][3]<[Point][4]>** to be clustered -* `maxDistance` **[number][5]** Maximum Distance between any point of the cluster to generate the clusters (kilometers only) +* `maxDistance` **[number][5]** Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options) * `options` **[Object][6]** Optional parameters (optional, default `{}`) * `options.units` **[string][7]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) diff --git a/packages/turf-clusters-dbscan/index.ts b/packages/turf-clusters-dbscan/index.ts index 7ad8906200..fa89f4e8b4 100644 --- a/packages/turf-clusters-dbscan/index.ts +++ b/packages/turf-clusters-dbscan/index.ts @@ -24,7 +24,7 @@ type IndexedPoint = { * * @name clustersDbscan * @param {FeatureCollection} points to be clustered - * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers only) + * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options) * @param {Object} [options={}] Optional parameters * @param {string} [options.units="kilometers"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated diff --git a/packages/turf-distance/README.md b/packages/turf-distance/README.md index 79342a31b5..8698f12f13 100644 --- a/packages/turf-distance/README.md +++ b/packages/turf-distance/README.md @@ -4,16 +4,16 @@ ## distance -Calculates the distance between two [points][1] in degrees, radians, miles, or kilometers. +Calculates the distance between two [coordinates][1] in degrees, radians, miles, or kilometers. This uses the [Haversine formula][2] to account for global curvature. ### Parameters -* `from` **([Coord][3] | [Point][4])** origin point or coordinate -* `to` **([Coord][3] | [Point][4])** destination point or coordinate -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `from` **[Coord][3]** origin coordinate +* `to` **[Coord][3]** destination coordinate +* `options` **[Object][4]** Optional parameters (optional, default `{}`) - * `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) + * `options.units` **[string][5]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) ### Examples @@ -30,21 +30,19 @@ from.properties.distance = distance; to.properties.distance = distance; ``` -Returns **[number][7]** distance between the two points +Returns **[number][6]** distance between the two coordinates -[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[1]: https://tools.ietf.org/html/rfc7946#section-3.1.1 [2]: http://en.wikipedia.org/wiki/Haversine_formula [3]: https://tools.ietf.org/html/rfc7946#section-3.1.1 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String - -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number