public class

WKTGeometryWriter

extends Object
java.lang.Object
   ↳ com.carto.geometry.WKTGeometryWriter

Class Overview

Generates Well Known Text (WKT) representation of the geometry.
Supports both 2D and 3D coordinate serialization.

Summary

Public Constructors
WKTGeometryWriter()
Constructs a new WKTGeometryWriter objects with default settings.
Public Methods
synchronized void delete()
boolean getZ()
Returns the state of Z coordinate serialization.
void setZ(boolean z)
Sets the state of Z coordinate serialization.
String writeGeometry(Geometry geometry)
Creates a WKT string corresponding to the specified geometry.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WKTGeometryWriter ()

Constructs a new WKTGeometryWriter objects with default settings.

Public Methods

public synchronized void delete ()

public boolean getZ ()

Returns the state of Z coordinate serialization.

Returns
  • True if Z coordinate is stored in WKT output, false otherwise. The default is false.

public void setZ (boolean z)

Sets the state of Z coordinate serialization.

Parameters
z True when Z coordinate should be serialized, false otherwise.

public String writeGeometry (Geometry geometry)

Creates a WKT string corresponding to the specified geometry.

Parameters
geometry The geometry to write.
Returns
  • The corresponding WKT string.
Throws
Exception If writing fails.