standardDeviationalEllipse
描述
¥Description
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.
This module mirrors the functionality of 方向分布 in ArcGIS and the 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 | the property name used to weight the center |
options.steps? | number | number of steps for the polygon (default 64) |
options.properties? | 对象 | properties to pass to the resulting ellipse (default ) |
返回
¥Returns
特性<多边形> an elliptical Polygon that includes approximately 1 SD of the dataset within it.
¥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(...);