Skip to main content
Version: 7.3.0

nearestNeighborAnalysis

描述

🌐 Description

最近邻分析根据数据集中点之间的平均距离计算一个指数,从而推断数据在研究区域内是聚类、分散还是随机分布的。

🌐 Nearest Neighbor Analysis calculates an index based on the average distances between points in the dataset, thereby providing inference as to whether the data is clustered, dispersed, or randomly distributed within the study area.

它返回研究区域的 Feature<Polygon>,分析结果作为研究区域的 propertiesnearestNeighborAnalysis 属性的一部分附加。附加的 z-score 表示数据的观测平均距离比预期平均距离高出或低出多少个标准差。z 分数越负,聚集程度越高。z 分数越正,分布越均匀。z 分数在 -2 到 2 之间表示分布看似随机。也就是说,在 p 值小于 0.05 的情况下,分布在统计上显著既不聚集也不分散。

🌐 It returns a Feature<Polygon> of the study area, with the results of the analysis attached as part of of the nearestNeighborAnalysis property of the study area's properties. The attached z-score indicates how many standard deviations above or below the expected mean distance the data's observed mean distance is. The more negative, the more clustered. The more positive, the more evenly dispersed. A z-score between -2 and 2 indicates a seemingly random distribution. That is, within p of less than 0.05, the distribution appears statistically significantly neither clustered nor dispersed.

备注

  • 虽然该分析可以应用于任何 FeatureCollection 类型,但它在 Point 集合上效果最好。
  • 此分析对提供的研究区域非常敏感。如果未传入 Feature<Polygon> 作为研究区域,该函数会在数据周围绘制一个框,这可能会扭曲结果。此分析在数据集中、分散或随机分布的有限兴趣区域内效果最佳。例如,如果研究区域是整个州,则一个城市的地铁站可能看起来非常集中。另一方面,如果研究区域仅限于城市的市中心,它们可能看起来相当均匀分布。

参考文献

Philip J. Clark 和 Francis C. Evans,“距离最近邻居作为群体空间关系的测度,”《生态学》35卷,第4期(1954):445–453,doi:10.2307/1931034

🌐 Philip J. Clark and Francis C. Evans, “Distance to Nearest Neighbor as a Measure of Spatial Relationships in Populations,” Ecology 35, no. 4 (1954): 445–453, doi:10.2307/1931034.

参数

🌐 Parameters

名称类型描述
datasetFeatureCollection<any>要研究的要素集合(以点为主)
options?Object可选参数 (默认 {})
options.studyArea?Feature<Polygon>表示研究区域的多边形
options.properties?GeoJsonProperties属性 (默认 {})

返回

🌐 Returns

NearestNeighborStudyArea 研究区域的多边形或其近似形。

示例

🌐 Examples

var bbox = [-65, 40, -63, 42];
var dataset = turf.randomPoint(100, { bbox: bbox });
var nearestNeighborStudyArea = turf.nearestNeighborAnalysis(dataset);

安装

🌐 Installation

$ npm install @turf/nearest-neighbor-analysis

import { nearestNeighborAnalysis } from "@turf/nearest-neighbor-analysis";
const result = nearestNeighborAnalysis(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.nearestNeighborAnalysis(...);