00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_IO_WKBREADER_H
00018 #define GEOS_IO_WKBREADER_H
00019
00020 #include <geos/geom/GeometryFactory.h>
00021 #include <geos/io/ByteOrderDataInStream.h>
00022
00023 #include <iosfwd>
00024 #include <vector>
00025 #include <string>
00026
00027
00028 namespace geos {
00029 namespace geom {
00030
00031
00032 class Coordinate;
00033 class Geometry;
00034 class GeometryCollection;
00035 class Point;
00036 class LineString;
00037 class LinearRing;
00038 class Polygon;
00039 class MultiPoint;
00040 class MultiLineString;
00041 class MultiPolygon;
00042 class PrecisionModel;
00043
00044 }
00045 }
00046
00047
00048 namespace geos {
00049 namespace io {
00050
00067 class WKBReader {
00068
00069 public:
00070
00071 WKBReader(geom::GeometryFactory const& f): factory(f) {};
00072
00074 WKBReader();
00075
00084 geom::Geometry* read(std::istream &is);
00085
00086
00095 geom::Geometry *readHEX(std::istream &is);
00096
00097
00104 static std::ostream &printHEX(std::istream &is, std::ostream &os);
00105
00106 private:
00107
00108 static std::string BAD_GEOM_TYPE_MSG;
00109
00110 const geom::GeometryFactory &factory;
00111
00112
00113 unsigned int inputDimension;
00114
00115 ByteOrderDataInStream dis;
00116
00117 std::vector<double> ordValues;
00118
00119 geom::Geometry *readGeometry();
00120
00121
00122 geom::Point *readPoint();
00123
00124
00125 geom::LineString *readLineString();
00126
00127
00128 geom::LinearRing *readLinearRing();
00129
00130
00131 geom::Polygon *readPolygon();
00132
00133
00134 geom::MultiPoint *readMultiPoint();
00135
00136
00137 geom::MultiLineString *readMultiLineString();
00138
00139
00140 geom::MultiPolygon *readMultiPolygon();
00141
00142
00143 geom::GeometryCollection *readGeometryCollection();
00144
00145
00146 geom::CoordinateSequence *readCoordinateSequence(int);
00147
00148 void readCoordinate();
00149
00150
00151 };
00152
00153 }
00154 }
00155
00156
00157 #endif // #ifndef GEOS_IO_WKBREADER_H
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170