autk-map / TriangulatorPolygons
Class: TriangulatorPolygons
Defined in: triangulator-polygons.ts:11
Class for triangulating polygons from GeoJSON features. It provides methods to convert different geometry types into polygon meshes.
Constructors
Constructor
new TriangulatorPolygons():
TriangulatorPolygons
Returns
TriangulatorPolygons
Methods
buildBorder()
staticbuildBorder(geojson,origin): [ILayerBorder[],ILayerBorderComponent[]]
Defined in: triangulator-polygons.ts:70
Converts GeoJSON features into a collection of borders.
Parameters
geojson
FeatureCollection
The GeoJSON feature collection
origin
number[]
The origin point for translation
Returns
[ILayerBorder[], ILayerBorderComponent[]]
An array of borders
buildMesh()
staticbuildMesh(geojson,origin): [ILayerGeometry[],ILayerComponent[]]
Defined in: triangulator-polygons.ts:18
Builds a mesh from GeoJSON features representing polygons.
Parameters
geojson
FeatureCollection
The GeoJSON feature collection
origin
number[]
The origin point for translation
Returns
[ILayerGeometry[], ILayerComponent[]]
An array of geometries and components
generateBorderIds()
protectedstaticgenerateBorderIds(nCoords):number[]
Defined in: triangulator-polygons.ts:302
Generates border indices for a given number of coordinates.
Parameters
nCoords
number
The number of coordinates
Returns
number[]
An array of border indices
lineStringToBorderMesh()
staticlineStringToBorderMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:141
Converts a LineString feature to a border representation.
Parameters
feature
Feature
The GeoJSON feature representing a LineString
origin
number[]
The origin point for translation
Returns
object[]
An array of borders
lineStringToMesh()
staticlineStringToMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:126
Converts a LineString feature to a border representation.
Parameters
feature
Feature
The GeoJSON feature representing a LineString
origin
number[]
The origin point for translation
Returns
object[]
An array of borders
multiLineStringToBorderMesh()
staticmultiLineStringToBorderMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:177
Converts a MultiLineString feature to a border representation.
Parameters
feature
Feature
The GeoJSON feature representing a MultiLineString
origin
number[]
The origin point for translation
Returns
object[]
An array of borders
multiLineStringToMesh()
staticmultiLineStringToMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:156
Converts a MultiLineString feature to a mesh representation.
Parameters
feature
Feature
The GeoJSON feature representing a MultiLineString
origin
number[]
The origin point for translation
Returns
object[]
An array of geometries
multiPolygonToBorderMesh()
staticmultiPolygonToBorderMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:274
Converts a MultiPolygon feature to a border representation.
Parameters
feature
Feature
The GeoJSON feature representing a MultiPolygon
origin
number[]
The origin point for translation
Returns
object[]
An array of borders
multiPolygonToMesh()
staticmultiPolygonToMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:245
Converts a MultiPolygon feature to a mesh representation.
Parameters
feature
Feature
The GeoJSON feature representing a MultiPolygon
origin
number[]
The origin point for translation
Returns
object[]
An array of geometries
polygonToBorderMesh()
staticpolygonToBorderMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:221
Converts a Polygon feature to a border representation.
Parameters
feature
Feature
The GeoJSON feature representing a Polygon
origin
number[]
The origin point for translation
Returns
object[]
An array of borders
polygonToMesh()
staticpolygonToMesh(feature,origin):object[]
Defined in: triangulator-polygons.ts:198
Converts a Polygon feature to a mesh representation.
Parameters
feature
Feature
The GeoJSON feature representing a Polygon
origin
number[]
The origin point for translation
Returns
object[]
An array of geometries