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
00026
00027 namespace geos {
00028 namespace geom {
00029
00030
00031 class Coordinate;
00032 class Geometry;
00033 class GeometryCollection;
00034 class Point;
00035 class LineString;
00036 class LinearRing;
00037 class Polygon;
00038 class MultiPoint;
00039 class MultiLineString;
00040 class MultiPolygon;
00041 class PrecisionModel;
00042
00043 }
00044 }
00045
00046
00047 namespace geos {
00048 namespace io {
00049
00066 class WKBReader {
00067
00068 public:
00069
00070 WKBReader(geom::GeometryFactory const& f): factory(f) {};
00071
00073 WKBReader();
00074
00083 geom::Geometry* read(std::istream &is);
00084
00085
00094 geom::Geometry *readHEX(std::istream &is);
00095
00096
00103 static std::ostream &printHEX(std::istream &is, std::ostream &os);
00104
00105 private:
00106
00107 static std::string BAD_GEOM_TYPE_MSG;
00108
00109 const geom::GeometryFactory &factory;
00110
00111
00112 unsigned int inputDimension;
00113
00114 ByteOrderDataInStream dis;
00115
00116 std::vector<double> ordValues;
00117
00118 geom::Geometry *readGeometry();
00119
00120
00121 geom::Point *readPoint();
00122
00123
00124 geom::LineString *readLineString();
00125
00126
00127 geom::LinearRing *readLinearRing();
00128
00129
00130 geom::Polygon *readPolygon();
00131
00132
00133 geom::MultiPoint *readMultiPoint();
00134
00135
00136 geom::MultiLineString *readMultiLineString();
00137
00138
00139 geom::MultiPolygon *readMultiPolygon();
00140
00141
00142 geom::GeometryCollection *readGeometryCollection();
00143
00144
00145 geom::CoordinateSequence *readCoordinateSequence(int);
00146
00147 void readCoordinate();
00148
00149
00150 };
00151
00152 }
00153 }
00154
00155
00156 #endif // #ifndef GEOS_IO_WKBREADER_H
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169