# geos::io::WKTWriter Class Reference

Outputs the textual representation of a Geometry. See also WKTReader. More...

`#include <geos.h>`

List of all members.

## Public Member Functions

std::string | write (const geom::Geometry *geometry)
| Returns WKT string for the given Geometry.
void | write (const geom::Geometry *geometry, Writer *writer)
std::string | writeFormatted (const geom::Geometry *geometry)
void | writeFormatted (const geom::Geometry *geometry, Writer *writer)

## Static Public Member Functions

static std::string | toLineString (const geom::CoordinateSequence &seq)
static std::string | toLineString (const geom::Coordinate &p0, const geom::Coordinate &p1)
static std::string | toPoint (const geom::Coordinate &p0)

## Protected Member Functions

void | appendGeometryTaggedText (const geom::Geometry *geometry, int level, Writer *writer)
void | appendPointTaggedText (const geom::Coordinate *coordinate, int level, Writer *writer)
void | appendLineStringTaggedText (const geom::LineString *lineString, int level, Writer *writer)
void | appendLinearRingTaggedText (const geom::LinearRing *lineString, int level, Writer *writer)
void | appendPolygonTaggedText (const geom::Polygon *polygon, int level, Writer *writer)
void | appendMultiPointTaggedText (const geom::MultiPoint *multipoint, int level, Writer *writer)
void | appendMultiLineStringTaggedText (const geom::MultiLineString *multiLineString, int level, Writer *writer)
void | appendMultiPolygonTaggedText (const geom::MultiPolygon *multiPolygon, int level, Writer *writer)
void | appendGeometryCollectionTaggedText (const geom::GeometryCollection *geometryCollection, int level, Writer *writer)
void | appendPointText (const geom::Coordinate *coordinate, int level, Writer *writer)
void | appendCoordinate (const geom::Coordinate *coordinate, Writer *writer)
std::string | writeNumber (double d)
void | appendLineStringText (const geom::LineString *lineString, int level, bool doIndent, Writer *writer)
void | appendPolygonText (const geom::Polygon *polygon, int level, bool indentFirst, Writer *writer)
void | appendMultiPointText (const geom::MultiPoint *multiPoint, int level, Writer *writer)
void | appendMultiLineStringText (const geom::MultiLineString *multiLineString, int level, bool indentFirst, Writer *writer)
void | appendMultiPolygonText (const geom::MultiPolygon *multiPolygon, int level, Writer *writer)
void | appendGeometryCollectionText (const geom::GeometryCollection *geometryCollection, int level, Writer *writer)

## Protected Attributes

std::string | formatter

## Detailed Description

Outputs the textual representation of a Geometry. See also WKTReader.

The WKTWriter outputs coordinates rounded to the precision model. No more than the maximum number of necessary decimal places will be output.

The Well-known Text format is defined in the OpenGIS Simple Features Specification for SQL.

A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does not define a special tag for LinearRings. The standard tag to use is "LINESTRING".

See WKTReader for parsing.

## Member Function Documentation

static std::string geos::io::WKTWriter::toLineString | ( | const geom::CoordinateSequence & | seq ) | `[static]`

Generates the WKT for a N-point `LineString`.

Parameters:

  seq | the sequence to outpout

Returns:
  the WKT

static std::string geos::io::WKTWriter::toLineString | ( | const geom::Coordinate & | p0,
|  | const geom::Coordinate & | p1
| ) |  | `[static]`

Generates the WKT for a 2-point `LineString`.

Parameters:

  p0 | the first coordinate
  p1 | the second coordinate

Returns:
  the WKT

static std::string geos::io::WKTWriter::toPoint | ( | const geom::Coordinate & | p0 ) | `[static]`

Generates the WKT for a `Point`.

Parameters:

  p0 | the point coordinate

Returns:
  the WKT

The documentation for this class was generated from the following file:

- WKTWriter.h