Appearance
KBE3D / KBCore / turf / unkinkPolygon
函数: unkinkPolygon()
unkinkPolygon<
T>(geojson:T|Feature<T,GeoJsonProperties> |FeatureCollection<T,GeoJsonProperties>):FeatureCollection<Polygon>
Function
Takes a kinked polygon and returns a feature collection of polygons that have no kinks.
Uses simplepolygon internally.
类型参数
T
T extends Polygon | MultiPolygon
参数
geojson
polygons to unkink
T | Feature<T, GeoJsonProperties> | FeatureCollection<T, GeoJsonProperties>
返回
Unkinked polygons
示例
ts
const poly = turf.polygon([[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]);
const result = turf.unkinkPolygon(poly);
//addToMap
const addToMap = [poly, result]