# concave
Takes a set of points and returns a concave hull Polygon or MultiPolygon. Internally, this uses turf-tin to generate geometries.
获取一组点并返回一个凹Polygon
或MultiPolygon
。在内部,它使用turf-tin
生成几何图形。
参数
参数 | 类型 | 描述 |
---|---|---|
points | FeatureCollection <Point> | input points |
options | Object | Optional parameters: see below |
options选项
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
maxEdge | number | Infinity | the length (in 'units') of an edge necessary for part of the hull to become concave. |
units | string | kilometers | can be degrees, radians, miles, or kilometers |
返回
(Feature <(Polygon|MultiPolygon)>|null) - a concave hull (null value is returned if unable to compute hull)
示例
var points = turf.featureCollection([
turf.point([-63.601226, 44.642643]),
turf.point([-63.591442, 44.651436]),
turf.point([-63.580799, 44.648749]),
turf.point([-63.573589, 44.641788]),
turf.point([-63.587665, 44.64533]),
turf.point([-63.595218, 44.64765])
]);
var options = {units: 'miles', maxEdge: 1};
var hull = turf.concave(points, options);
