00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_IO_WKBREADER_H
00022 #define GEOS_IO_WKBREADER_H
00023
00024 #include <geos/export.h>
00025
00026 #include <geos/geom/GeometryFactory.h>
00027 #include <geos/io/ByteOrderDataInStream.h>
00028
00029 #include <iosfwd>
00030 #include <vector>
00031 #include <string>
00032
00033 #define BAD_GEOM_TYPE_MSG "Bad geometry type encountered in"
00034
00035
00036
00037 namespace geos {
00038 namespace geom {
00039
00040
00041 class Coordinate;
00042 class Geometry;
00043 class GeometryCollection;
00044 class Point;
00045 class LineString;
00046 class LinearRing;
00047 class Polygon;
00048 class MultiPoint;
00049 class MultiLineString;
00050 class MultiPolygon;
00051 class PrecisionModel;
00052
00053 }
00054 }
00055
00056
00057 namespace geos {
00058 namespace io {
00059
00076 class GEOS_DLL WKBReader {
00077
00078 public:
00079
00080 WKBReader(geom::GeometryFactory const& f): factory(f) {};
00081
00083 WKBReader();
00084
00093 geom::Geometry* read(std::istream &is);
00094
00095
00104 geom::Geometry *readHEX(std::istream &is);
00105
00106
00113 static std::ostream &printHEX(std::istream &is, std::ostream &os);
00114
00115 private:
00116
00117 const geom::GeometryFactory &factory;
00118
00119
00120 unsigned int inputDimension;
00121
00122 ByteOrderDataInStream dis;
00123
00124 std::vector<double> ordValues;
00125
00126 geom::Geometry *readGeometry();
00127
00128
00129 geom::Point *readPoint();
00130
00131
00132 geom::LineString *readLineString();
00133
00134
00135 geom::LinearRing *readLinearRing();
00136
00137
00138 geom::Polygon *readPolygon();
00139
00140
00141 geom::MultiPoint *readMultiPoint();
00142
00143
00144 geom::MultiLineString *readMultiLineString();
00145
00146
00147 geom::MultiPolygon *readMultiPolygon();
00148
00149
00150 geom::GeometryCollection *readGeometryCollection();
00151
00152
00153 geom::CoordinateSequence *readCoordinateSequence(int);
00154
00155 void readCoordinate();
00156
00157
00158 WKBReader(const WKBReader& other);
00159 WKBReader& operator=(const WKBReader& rhs);
00160 };
00161
00162 }
00163 }
00164
00165
00166 #endif // #ifndef GEOS_IO_WKBREADER_H
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179