Class: WKTWriter

jsts.io.WKTWriter

new WKTWriter()

Writes the Well-Known Text representation of a Geometry. The Well-Known Text format is defined in the OGC Simple Features Specification for SQL.

The WKTWriter outputs coordinates rounded to the precision model. Only the maximum number of decimal places necessary to represent the ordinates to the required precision will be output.

The SFS WKT spec does not define a special tag for LinearRings. Under the spec, rings are output as LINESTRINGs.

Source:
See:
  • WKTReader

Methods

(static) toLineString(p0, p1)

Generates the WKT for a LINESTRING specified by two Coordinates.
Parameters:
Name Type Description
p0 the first coordinate.
p1 the second coordinate.
Source:
Returns:
the WKT.

write(geometry) → {string}

Converts a Geometry to its Well-known Text representation.
Parameters:
Name Type Description
geometry jsts.geom.Geometry a Geometry to process.
Source:
Returns:
a string (see the OpenGIS Simple Features Specification).
Type
string