Module wkt

Index

Functions

Functions

parse(wkt: string): any

Parses WKT as a geometry and determines its type from the string.

Parameters

  • wkt: string

Returns

any

The parsed shape, a point, geometry, or an array of polygons depending on the WKT.

parseLineString(wkt: string): geometry

Parses WKT as an open path geometry with a single set.

Parameters

  • wkt: string

Returns

geometry

The parsed open path geometry.

parseMultiLineString(wkt: string): geometry

Parses WKT as an open path geometry with multiple sets.

Parameters

  • wkt: string

Returns

geometry

The parsed open path geometry.

parseMultiPoint(wkt: string): geometry

Parses WKT as a multipoint.

retuns

{geometry} The parsed multipoint geometry.

Parameters

  • wkt: string

Returns

geometry

parseMultiPolygon(wkt: string): geometry

Parses WKT as a closed path geometry with multiple sets.

Parameters

  • wkt: string

Returns

geometry

The parsed closed path geometry.

parsePoint(wkt: string): point

Parses WKT as a point.

Parameters

  • wkt: string

Returns

point

The parsed point.

parsePolygon(wkt: string): geometry

Parses WKT as a closed path geometry with a single set.

Parameters

  • wkt: string

Returns

geometry

The parsed closed path geometry.

toMultiPolygonString(polys: polygon[]): string

Converts an array of polygons to an OGC compliant multipolygon WKT string.

Parameters

  • polys: polygon[]

    Set of polygons to parse into WKT.

Returns

string

The OGC compliant WKT for the polygons.