Skip to content

KBE3D / KBCore / turf / polygonize

函数: polygonize()

polygonize<T>(geoJson: T | Feature<T, GeoJsonProperties> | FeatureCollection<T, GeoJsonProperties>): FeatureCollection<Polygon>

Function

Polygonizes (Multi)LineString(s) into Polygons.

Implementation of GEOSPolygonize function (geos::operation::polygonize::Polygonizer).

Polygonizes a set of lines that represents edges in a planar graph. Edges must be correctly noded, i.e., they must only meet at their endpoints.

The implementation correctly handles:

  • Dangles: edges which have one or both ends which are not incident on another edge endpoint.
  • Cut Edges (bridges): edges that are connected at both ends but which do not form part of a polygon.

类型参数

T

T extends LineString | MultiLineString

参数

geoJson

Lines in order to polygonize

T | Feature<T, GeoJsonProperties> | FeatureCollection<T, GeoJsonProperties>

返回

FeatureCollection<Polygon>

Polygons created

抛出

if geoJson is invalid.

KBE3D @3.0.0 Copyright © 2024-present KBE3D