GEOS 3.11.1
|
Outputs the textual representation of a Geometry. See also WKTReader. More...
#include <WKTWriter.h>
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) |
void | setRoundingPrecision (int p0) |
void | setTrim (bool p0) |
void | setOld3D (bool useOld3D) |
int | getOutputDimension () const |
void | setOutputDimension (uint8_t newOutputDimension) |
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) const |
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 | |
int | decimalPlaces |
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.
|
inline |
Enable old style 3D/4D WKT generation.
By default the WKBWriter produces new style 3D/4D WKT (ie. "POINT Z (10 20 30)") but if this method is used to turn on old style WKT production then the WKT will be formatted in the style "POINT (10 20 30)".
useOld3D | true or false |
void geos::io::WKTWriter::setRoundingPrecision | ( | int | p0 | ) |
Sets the rounding precision when writing the WKT a precision of -1 disables it
p0 | the new precision to use |
void geos::io::WKTWriter::setTrim | ( | bool | p0 | ) |
Enables/disables trimming of unnecessary decimals
p0 | the trim boolean |
|
static |
Generates the WKT for a 2-point LineString
.
p0 | the first coordinate |
p1 | the second coordinate |
|
static |
Generates the WKT for a N-point LineString
.
seq | the sequence to outpout |
|
static |
Generates the WKT for a Point
.
p0 | the point coordinate |