Skip to main content
Version: Next

convex

描述

¥Description

Takes a 特性 or a FeatureCollection and returns a convex hull 多边形.

¥Takes a Feature or a FeatureCollection and returns a convex hull Polygon.

Internally this uses the convex-hull module that implements a 单调链包.

¥Internally this uses the convex-hull module that implements a monotone chain hull.

参数

¥Parameters

名称类型描述
geojsonGeoJSON输入要素或要素集合
options?对象可选参数(默认
options.concavity?number1 - 细化形状。无穷大 - 凸包。(默认 Infinity)
options.properties?对象Translate Properties to Feature (default )

返回

¥Returns

特性<多边形> 凸包

¥Feature<Polygon> a convex hull

示例

¥Examples

var points = turf.featureCollection([
turf.point([10.195312, 43.755225]),
turf.point([10.404052, 43.8424511]),
turf.point([10.579833, 43.659924]),
turf.point([10.360107, 43.516688]),
turf.point([10.14038, 43.588348]),
turf.point([10.195312, 43.755225]),
]);

var hull = turf.convex(points);

安装

¥Installation

$ npm install @turf/convex

import { convex } from "@turf/convex";
const result = convex(...);
$ npm install @turf/turf

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