Skip to main content
Version: 7.1.0

unkinkPolygon

Description

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

Uses simplepolygon internally.

Parameters

NameTypeDescription
geojsonFeatureCollection<Polygon | MultiPolygon> | Feature<Polygon | MultiPolygon> | Polygon | MultiPolygonpolygons to unkink

Returns

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