22#include <geos/export.h>
24#include <geos/geom/GeometryFactory.h>
25#include <geos/geom/Geometry.h>
26#include <geos/io/ParseException.h>
37class CoordinateSequence;
38class GeometryCollection;
70 : geometryFactory(&gf)
71 , precisionModel(gf.getPrecisionModel())
78 , precisionModel(gf->getPrecisionModel())
87 : geometryFactory(geom::GeometryFactory::getDefaultInstance())
88 , precisionModel(geometryFactory->getPrecisionModel())
95 setFixStructure(
bool doFixStructure) {
96 fixStructure = doFixStructure;
101 std::unique_ptr<T>
read(
const std::string& wkt)
const {
103 auto gt =
dynamic_cast<const T*
>(g.get());
108 return std::unique_ptr<T>(
static_cast<T*
>(g.release()));
111 std::unique_ptr<geom::Geometry> read(
const std::string& wellKnownText)
const;
114 std::unique_ptr<geom::CoordinateSequence> getCoordinates(io::StringTokenizer* tokenizer)
const;
115 static double getNextNumber(io::StringTokenizer* tokenizer);
116 static std::string getNextEmptyOrOpener(io::StringTokenizer* tokenizer, std::size_t& dim);
117 static std::string getNextCloserOrComma(io::StringTokenizer* tokenizer);
118 static std::string getNextCloser(io::StringTokenizer* tokenizer);
119 static std::string getNextWord(io::StringTokenizer* tokenizer);
120 std::unique_ptr<geom::Geometry> readGeometryTaggedText(io::StringTokenizer* tokenizer)
const;
121 std::unique_ptr<geom::Point> readPointText(io::StringTokenizer* tokenizer)
const;
122 std::unique_ptr<geom::LineString> readLineStringText(io::StringTokenizer* tokenizer)
const;
123 std::unique_ptr<geom::LinearRing> readLinearRingText(io::StringTokenizer* tokenizer)
const;
124 std::unique_ptr<geom::MultiPoint> readMultiPointText(io::StringTokenizer* tokenizer)
const;
125 std::unique_ptr<geom::Polygon> readPolygonText(io::StringTokenizer* tokenizer)
const;
126 std::unique_ptr<geom::MultiLineString> readMultiLineStringText(io::StringTokenizer* tokenizer)
const;
127 std::unique_ptr<geom::MultiPolygon> readMultiPolygonText(io::StringTokenizer* tokenizer)
const;
128 std::unique_ptr<geom::GeometryCollection> readGeometryCollectionText(io::StringTokenizer* tokenizer)
const;
134 void getPreciseCoordinate(io::StringTokenizer* tokenizer,
geom::Coordinate&, std::size_t& dim)
const;
136 static bool isNumberNext(io::StringTokenizer* tokenizer);
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:90
Notifies a parsing error.
Definition: ParseException.h:33
WKT parser class; see also WKTWriter.
Definition: WKTReader.h:58
std::unique_ptr< T > read(const std::string &wkt) const
Parse a WKT string returning a Geometry.
Definition: WKTReader.h:101
WKTReader(const geom::GeometryFactory *gf)
Definition: WKTReader.h:76
WKTReader()
Initialize parser with default GeometryFactory.
Definition: WKTReader.h:86
WKTReader(const geom::GeometryFactory &gf)
Initialize parser with given GeometryFactory.
Definition: WKTReader.h:69
Basic namespace for all GEOS functionalities.
Definition: geos.h:39