Skip to main content
Version: 7.3.0

unkinkPolygon

描述

🌐 Description

接受一个弯折的多边形并返回一个没有弯折的多边形要素集合。

🌐 Takes a kinked polygon and returns a feature collection of polygons that have no kinks.

内部使用 simplepolygon

🌐 Uses simplepolygon internally.

参数

🌐 Parameters

名称类型描述
geojsonFeatureCollection<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(...);