76 : geometryFactory(&gf)
77 , precisionModel(gf.getPrecisionModel())
84 , precisionModel(gf->getPrecisionModel())
93 : geometryFactory(geom::GeometryFactory::getDefaultInstance())
94 , precisionModel(geometryFactory->getPrecisionModel())
101 setFixStructure(
bool doFixStructure) {
102 fixStructure = doFixStructure;
107 std::unique_ptr<T>
read(
const std::string& wkt)
const {
109 auto gt =
dynamic_cast<const T*
>(g.get());
114 return std::unique_ptr<T>(
static_cast<T*
>(g.release()));
117 std::unique_ptr<geom::Geometry> read(
const std::string& wellKnownText)
const;
120 std::unique_ptr<geom::CoordinateSequence> getCoordinates(io::StringTokenizer* tokenizer,
OrdinateSet& ordinates)
const;
121 static double getNextNumber(io::StringTokenizer* tokenizer);
122 static std::string getNextEmptyOrOpener(io::StringTokenizer* tokenizer,
OrdinateSet& dim);
123 static std::string getNextCloserOrComma(io::StringTokenizer* tokenizer);
124 static std::string getNextCloser(io::StringTokenizer* tokenizer);
125 static std::string getNextWord(io::StringTokenizer* tokenizer);
126 std::unique_ptr<geom::Geometry> readGeometryTaggedText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags,
const geom::GeometryTypeId* emptyType =
nullptr)
const;
128 std::unique_ptr<geom::Point> readPointText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
129 std::unique_ptr<geom::LineString> readLineStringText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
130 std::unique_ptr<geom::LinearRing> readLinearRingText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
131 std::unique_ptr<geom::MultiPoint> readMultiPointText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
132 std::unique_ptr<geom::Polygon> readPolygonText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
133 std::unique_ptr<geom::MultiLineString> readMultiLineStringText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
134 std::unique_ptr<geom::MultiPolygon> readMultiPolygonText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
135 std::unique_ptr<geom::GeometryCollection> readGeometryCollectionText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
136 std::unique_ptr<geom::CircularString> readCircularStringText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
137 std::unique_ptr<geom::CompoundCurve> readCompoundCurveText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
138 std::unique_ptr<geom::CurvePolygon> readCurvePolygonText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
139 std::unique_ptr<geom::MultiCurve> readMultiCurveText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
140 std::unique_ptr<geom::MultiSurface> readMultiSurfaceText(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags)
const;
152 void getPreciseCoordinate(io::StringTokenizer* tokenizer,
OrdinateSet& ordinateFlags, geom::CoordinateXYZM&)
const;
154 static bool isNumberNext(io::StringTokenizer* tokenizer);
155 static bool isOpenerNext(io::StringTokenizer* tokenizer);
157 static void readOrdinateFlags(
const std::string & s,
OrdinateSet& ordinateFlags);
158 static bool isTypeName(
const std::string & type,
const std::string & typeName);
Utility class to manipulate a set of flags indicating whether X, Y, Z, or M dimensions are present....
Definition OrdinateSet.h:29
std::unique_ptr< T > read(const std::string &wkt) const
Parse a WKT string returning a Geometry.
Definition WKTReader.h:107
std::unique_ptr< geom::Curve > readCurveText(io::StringTokenizer *tokenizer, OrdinateSet &ordinateFlags) const
Read the contents of a LINEARRING, LINESTRING, CIRCULARSTRING, or COMPOUNDCURVE.