Skip to content

autk-map


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

static buildBorder(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()

static buildMesh(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()

protected static generateBorderIds(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()

static lineStringToBorderMesh(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()

static lineStringToMesh(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()

static multiLineStringToBorderMesh(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()

static multiLineStringToMesh(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()

static multiPolygonToBorderMesh(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()

static multiPolygonToMesh(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()

static polygonToBorderMesh(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()

static polygonToMesh(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

Released under the MIT License.