Skip to main content

toWKT

Converts a geometry object to its Well-Known Text (WKT) representation.

Parameters

NameTypeDefaultDescription
geometryGeometryThe geometry object to be converted to WKT
options?objectOptional WKT output configuration
options.dim?2 | 3 | 44Output dimensionality of the writer.
options.precision?number16Number places after the decimal to output in WKT.
options.trim?booleantrueTrim trailing 0's from the output coordinates.

Returns

string

String with WKT representation of the geometry

See also

Examples