Skip to content

KBE3D / KBCore / turf / concave

函数: concave()

concave(points: FeatureCollection<Point>, options?: { maxEdge?: number; units?: Units; }): Feature<Polygon | MultiPolygon, GeoJsonProperties> | null

Function

Takes a set of points and returns a concave hull Polygon or MultiPolygon. Internally, this uses turf-tin

to generate geometries.

参数

points

FeatureCollection<Point>

input points

options?

Optional parameters

maxEdge?

number

the length (in 'units') of an edge necessary for part of the hull to become concave.

units?

Units

Supports all valid Turf Units

.

返回

Feature<Polygon | MultiPolygon, GeoJsonProperties> | null

a concave hull (null value is returned if unable to compute hull)

示例

ts
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);

//addToMap
var addToMap = [points, hull]

KBE3D @3.0.0 Copyright © 2024-present KBE3D