unkinkPolygon
描述
🌐 Description
接受一个弯折的多边形并返回一个没有弯折的多边形要素集合。
🌐 Takes a kinked polygon and returns a feature collection of polygons that have no kinks.
内部使用 simplepolygon。
🌐 Uses simplepolygon internally.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| geojson | FeatureCollection<Polygon | MultiPolygon> | Feature<Polygon | MultiPolygon> | Polygon | MultiPolygon | 多边形去折皱 |
返回
🌐 Returns
FeatureCollection<Polygon> 未扭曲的多边形
示例
🌐 Examples
const poly = turf.polygon([
[
[0, 0],
[2, 0],
[0, 2],
[2, 2],
[0, 0],
],
]);
const result = turf.unkinkPolygon(poly);
安装
🌐 Installation
$ npm install @turf/unkink-polygon
import { unkinkPolygon } from "@turf/unkink-polygon";
const result = unkinkPolygon(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.unkinkPolygon(...);