22 #include <geos/export.h>
23 #include <geos/geom/Geometry.h>
24 #include <geos/geom/GeometryTypeName.h>
25 #include <geos/io/ByteOrderDataInStream.h>
34 #pragma warning(disable: 4251)
41 class GeometryFactory;
48 class GeometryCollection;
55 class MultiLineString;
59 class CoordinateSequence;
94 void setFixStructure(
bool doFixStructure);
104 std::unique_ptr<geom::Geometry>
read(std::istream& is);
115 std::unique_ptr<geom::Geometry>
read(
const unsigned char* buf,
size_t size);
125 std::unique_ptr<geom::Geometry>
readHEX(std::istream& is);
133 static std::ostream&
printHEX(std::istream& is, std::ostream& os);
140 unsigned int inputDimension;
147 std::array<double, 4> ordValues;
149 std::unique_ptr<geom::Geometry> readGeometry();
151 std::unique_ptr<geom::Point> readPoint();
153 std::unique_ptr<geom::LineString> readLineString();
155 std::unique_ptr<geom::LinearRing> readLinearRing();
157 std::unique_ptr<geom::CircularString> readCircularString();
159 std::unique_ptr<geom::CompoundCurve> readCompoundCurve();
161 std::unique_ptr<geom::Polygon> readPolygon();
163 std::unique_ptr<geom::CurvePolygon> readCurvePolygon();
165 std::unique_ptr<geom::MultiPoint> readMultiPoint();
167 std::unique_ptr<geom::MultiLineString> readMultiLineString();
169 std::unique_ptr<geom::MultiCurve> readMultiCurve();
171 std::unique_ptr<geom::MultiPolygon> readMultiPolygon();
173 std::unique_ptr<geom::MultiSurface> readMultiSurface();
175 std::unique_ptr<geom::GeometryCollection> readGeometryCollection();
177 std::unique_ptr<geom::CoordinateSequence> readCoordinateSequence(
unsigned int);
181 void readCoordinate();
184 std::unique_ptr<T> readChild()
186 auto g = readGeometry();
187 if (
dynamic_cast<const T*
>(g.get())) {
188 return std::unique_ptr<T>(
static_cast<T*
>(g.release()));
190 throw io::ParseException(std::string(
"Expected ") + geom::GeometryTypeName<T>::name +
" but got " + g->getGeometryType());
194 WKBReader(
const WKBReader& other) =
delete;
195 WKBReader& operator=(
const WKBReader& rhs) =
delete;
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Allows reading an stream of primitive datatypes from an underlying istream, with the representation b...
Definition: ByteOrderDataInStream.h:40
Notifies a parsing error.
Definition: ParseException.h:33
Reads a Geometry from Well-Known Binary format.
Definition: WKBReader.h:85
std::unique_ptr< geom::Geometry > read(const unsigned char *buf, size_t size)
Reads a Geometry from a buffer.
std::unique_ptr< geom::Geometry > readHEX(std::istream &is)
Reads a Geometry from an istream in hex format.
WKBReader()
Initialize parser with default GeometryFactory.
static std::ostream & printHEX(std::istream &is, std::ostream &os)
Print WKB in HEX form to out stream.
std::unique_ptr< geom::Geometry > read(std::istream &is)
Reads a Geometry from an istream.
GeometryTypeId
Geometry types.
Definition: Geometry.h:74
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25