Skip to content
pyautark (soon)

@urban-toolkit/autk-core


@urban-toolkit/autk-core / mapGeometryTypeToLayerType

Function: mapGeometryTypeToLayerType()

mapGeometryTypeToLayerType(geometryType): "points" | "polygons" | "polylines"

Defined in: utils-layer.ts:47

Maps a GeoJSON geometry type to the corresponding shared layer family.

Parameters

geometryType

"Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"

GeoJSON geometry type to classify.

Returns

"points" | "polygons" | "polylines"

One of points, polylines, or polygons.

Throws

Never throws.

Example

ts
mapGeometryTypeToLayerType('Polygon');  // 'polygons'
mapGeometryTypeToLayerType('Point');    // 'points'

Released under the MIT License.