@turf/nearest-neighbor-analysis 7.1.0-alpha.7 → 7.1.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 +18 -22
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -22,18 +22,16 @@ dispersed.
|
|
|
22
22
|
**Remarks**
|
|
23
23
|
|
|
24
24
|
* Though the analysis will work on any [FeatureCollection][3] type, it
|
|
25
|
-
|
|
26
|
-
works best with [Point][4] collections.
|
|
25
|
+
works best with [Point][4] collections.
|
|
27
26
|
|
|
28
27
|
* This analysis is *very* sensitive to the study area provided.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
look
|
|
35
|
-
|
|
36
|
-
the city's downtown.
|
|
28
|
+
If no [Feature\<Polygon>][1] is passed as the study area, the function draws a box
|
|
29
|
+
around the data, which may distort the findings. This analysis works best
|
|
30
|
+
with a bounded area of interest within with the data is either clustered,
|
|
31
|
+
dispersed, or randomly distributed. For example, a city's subway stops may
|
|
32
|
+
look extremely clustered if the study area is an entire state. On the other
|
|
33
|
+
hand, they may look rather evenly dispersed if the study area is limited to
|
|
34
|
+
the city's downtown.
|
|
37
35
|
|
|
38
36
|
**Bibliography**
|
|
39
37
|
|
|
@@ -43,12 +41,12 @@ Measure of Spatial Relationships in Populations,” *Ecology* 35, no. 4
|
|
|
43
41
|
|
|
44
42
|
### Parameters
|
|
45
43
|
|
|
46
|
-
* `dataset` **[FeatureCollection][
|
|
47
|
-
* `options` **[Object][
|
|
44
|
+
* `dataset` **[FeatureCollection][3]\<any>** FeatureCollection (pref. of points) to study
|
|
45
|
+
* `options` **[Object][6]** Optional parameters (optional, default `{}`)
|
|
48
46
|
|
|
49
|
-
* `options.studyArea` **[Feature][
|
|
50
|
-
* `options.units` **[string][
|
|
51
|
-
* `options.properties` **[Object][
|
|
47
|
+
* `options.studyArea` **[Feature][7]<[Polygon][8]>?** polygon representing the study area
|
|
48
|
+
* `options.units` **[string][9]** unit of measurement for distances and, squared, area. (optional, default `'kilometers'`)
|
|
49
|
+
* `options.properties` **[Object][6]** properties (optional, default `{}`)
|
|
52
50
|
|
|
53
51
|
### Examples
|
|
54
52
|
|
|
@@ -61,7 +59,7 @@ var nearestNeighborStudyArea = turf.nearestNeighborAnalysis(dataset);
|
|
|
61
59
|
var addToMap = [dataset, nearestNeighborStudyArea];
|
|
62
60
|
```
|
|
63
61
|
|
|
64
|
-
Returns **[Feature][
|
|
62
|
+
Returns **[Feature][7]<[Polygon][8]>** A polygon of the study area or an approximation of one.
|
|
65
63
|
|
|
66
64
|
[1]: Feature<Polygon>
|
|
67
65
|
|
|
@@ -73,15 +71,13 @@ Returns **[Feature][8]<[Polygon][9]>** A polygon of the study area or an approxi
|
|
|
73
71
|
|
|
74
72
|
[5]: http://doi.org/10.2307/1931034
|
|
75
73
|
|
|
76
|
-
[6]: https://
|
|
77
|
-
|
|
78
|
-
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
74
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
79
75
|
|
|
80
|
-
[
|
|
76
|
+
[7]: https://tools.ietf.org/html/rfc7946#section-3.2
|
|
81
77
|
|
|
82
|
-
[
|
|
78
|
+
[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6
|
|
83
79
|
|
|
84
|
-
[
|
|
80
|
+
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
85
81
|
|
|
86
82
|
<!-- 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. -->
|
|
87
83
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/nearest-neighbor-analysis",
|
|
3
|
-
"version": "7.1.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "turf nearest-neighbor-analysis module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"test:tape": "tsx test.ts"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@turf/truncate": "^7.1.0
|
|
55
|
+
"@turf/truncate": "^7.1.0",
|
|
56
56
|
"@types/benchmark": "^2.1.5",
|
|
57
57
|
"@types/tape": "^4.2.32",
|
|
58
58
|
"benchmark": "^2.1.4",
|
|
@@ -65,15 +65,16 @@
|
|
|
65
65
|
"write-json-file": "^5.0.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@turf/area": "^7.1.0
|
|
69
|
-
"@turf/bbox": "^7.1.0
|
|
70
|
-
"@turf/bbox-polygon": "^7.1.0
|
|
71
|
-
"@turf/centroid": "^7.1.0
|
|
72
|
-
"@turf/distance": "^7.1.0
|
|
73
|
-
"@turf/helpers": "^7.1.0
|
|
74
|
-
"@turf/meta": "^7.1.0
|
|
75
|
-
"@turf/nearest-point": "^7.1.0
|
|
68
|
+
"@turf/area": "^7.1.0",
|
|
69
|
+
"@turf/bbox": "^7.1.0",
|
|
70
|
+
"@turf/bbox-polygon": "^7.1.0",
|
|
71
|
+
"@turf/centroid": "^7.1.0",
|
|
72
|
+
"@turf/distance": "^7.1.0",
|
|
73
|
+
"@turf/helpers": "^7.1.0",
|
|
74
|
+
"@turf/meta": "^7.1.0",
|
|
75
|
+
"@turf/nearest-point": "^7.1.0",
|
|
76
|
+
"@types/geojson": "^7946.0.10",
|
|
76
77
|
"tslib": "^2.6.2"
|
|
77
78
|
},
|
|
78
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
|
|
79
80
|
}
|