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 #ifdef _MSC_VER
00036 #pragma warning(push)
00037 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00038 #endif
00039
00040
00041 namespace geos {
00042 namespace geom {
00043
00044
00045 class Coordinate;
00046 class Geometry;
00047 class GeometryCollection;
00048 class Point;
00049 class LineString;
00050 class LinearRing;
00051 class Polygon;
00052 class MultiPoint;
00053 class MultiLineString;
00054 class MultiPolygon;
00055 class PrecisionModel;
00056
00057 }
00058 }
00059
00060
00061 namespace geos {
00062 namespace io {
00063
00080 class GEOS_DLL WKBReader {
00081
00082 public:
00083
00084 WKBReader(geom::GeometryFactory const& f): factory(f) {};
00085
00087 WKBReader();
00088
00097 geom::Geometry* read(std::istream &is);
00098
00099
00108 geom::Geometry *readHEX(std::istream &is);
00109
00110
00117 static std::ostream &printHEX(std::istream &is, std::ostream &os);
00118
00119 private:
00120
00121 const geom::GeometryFactory &factory;
00122
00123
00124 unsigned int inputDimension;
00125
00126 ByteOrderDataInStream dis;
00127
00128 std::vector<double> ordValues;
00129
00130 geom::Geometry *readGeometry();
00131
00132
00133 geom::Point *readPoint();
00134
00135
00136 geom::LineString *readLineString();
00137
00138
00139 geom::LinearRing *readLinearRing();
00140
00141
00142 geom::Polygon *readPolygon();
00143
00144
00145 geom::MultiPoint *readMultiPoint();
00146
00147
00148 geom::MultiLineString *readMultiLineString();
00149
00150
00151 geom::MultiPolygon *readMultiPolygon();
00152
00153
00154 geom::GeometryCollection *readGeometryCollection();
00155
00156
00157 geom::CoordinateSequence *readCoordinateSequence(int);
00158
00159 void readCoordinate();
00160
00161
00162 WKBReader(const WKBReader& other);
00163 WKBReader& operator=(const WKBReader& rhs);
00164 };
00165
00166 }
00167 }
00168
00169 #ifdef _MSC_VER
00170 #pragma warning(pop)
00171 #endif
00172
00173 #endif // #ifndef GEOS_IO_WKBREADER_H
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186