standardDeviationalEllipse
描述
¥Description
获取一组特性并返回一个标准差椭圆,也称为“方向分布”。标准差椭圆旨在通过绘制一个包含大约一个标准差(约 70%)数据的椭圆来显示数据集的方向和分布。
¥Takes a collection of features and returns a standard deviational ellipse, also known as a “directional distribution.” The standard deviational ellipse aims to show the direction and the distribution of a dataset by drawing an ellipse that contains about one standard deviation’s worth (~ 70%) of the data.
此模块镜像了 ArcGIS 中 方向分布 和 QGIS 标准偏差椭圆插件 的功能。
¥This module mirrors the functionality of Directional Distribution in ArcGIS and the QGIS Standard Deviational Ellipse Plugin
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
points | FeatureCollection<点> | GeoJSON 点 |
options? | 对象 | 可选参数(默认 {}) |
options.weight? | string | 用于加权中心的属性名称 |
options.steps? | number | 多边形的步数(默认值 64) |
options.properties? | 对象 | 传递给生成的椭圆的属性(默认---左括号------右括号---) |
返回
¥Returns
特性<多边形> 一个椭圆多边形,其中包含约 1 个标准差的数据集。
¥Feature<Polygon> an elliptical Polygon that includes approximately 1 SD of the dataset within it.
示例
¥Examples
const bbox = [-74, 40.72, -73.98, 40.74];
const points = turf.randomPoint(400, { bbox: bbox });
const sdEllipse = turf.standardDeviationalEllipse(points);
安装
¥Installation
$ npm install @turf/standard-deviational-ellipse
import { standardDeviationalEllipse } from "@turf/standard-deviational-ellipse";
const result = standardDeviationalEllipse(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.standardDeviationalEllipse(...);