Skip to main content
Version: 6.5.0

unkinkPolygon

Description

Takes a kinked polygon and returns a feature collection of polygons that have no kinks. Uses simplepolygon internally.

Parameters

NameTypeDescription
geojsonFeatureCollection | Feature<Polygon | MultiPolygon>GeoJSON Polygon or MultiPolygon

Returns

Examples

var poly = turf.polygon([
[
[0, 0],
[2, 0],
[0, 2],
[2, 2],
[0, 0],
],
]);

var 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(...);