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