00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H
00022 #define GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H
00023
00024
00025 #include <geos/export.h>
00026 #include <geos/geom/Coordinate.h>
00027 #include <geos/geom/Geometry.h>
00028 #include <geos/geom/CoordinateSequence.h>
00029
00030 #include <memory>
00031 #include <vector>
00032
00033
00034 namespace geos {
00035 namespace geom {
00036 class Geometry;
00037 class GeometryFactory;
00038 class Point;
00039 class LinearRing;
00040 class LineString;
00041 class Polygon;
00042 class MultiPoint;
00043 class MultiPolygon;
00044 class MultiLineString;
00045 class GeometryCollection;
00046 namespace util {
00047
00048 }
00049 }
00050 }
00051
00052
00053 namespace geos {
00054 namespace geom {
00055 namespace util {
00056
00093 class GEOS_DLL GeometryTransformer {
00094
00095 public:
00096
00097 GeometryTransformer();
00098
00099 virtual ~GeometryTransformer();
00100
00101 std::auto_ptr<Geometry> transform(const Geometry* nInputGeom);
00102
00103 protected:
00104
00105 const GeometryFactory* factory;
00106
00116 CoordinateSequence::AutoPtr createCoordinateSequence(
00117 std::auto_ptr< std::vector<Coordinate> > coords);
00118
00119 virtual CoordinateSequence::AutoPtr transformCoordinates(
00120 const CoordinateSequence* coords,
00121 const Geometry* parent);
00122
00123 virtual Geometry::AutoPtr transformPoint(
00124 const Point* geom,
00125 const Geometry* parent);
00126
00127 virtual Geometry::AutoPtr transformMultiPoint(
00128 const MultiPoint* geom,
00129 const Geometry* parent);
00130
00131 virtual Geometry::AutoPtr transformLinearRing(
00132 const LinearRing* geom,
00133 const Geometry* parent);
00134
00135 virtual Geometry::AutoPtr transformLineString(
00136 const LineString* geom,
00137 const Geometry* parent);
00138
00139 virtual Geometry::AutoPtr transformMultiLineString(
00140 const MultiLineString* geom,
00141 const Geometry* parent);
00142
00143 virtual Geometry::AutoPtr transformPolygon(
00144 const Polygon* geom,
00145 const Geometry* parent);
00146
00147 virtual Geometry::AutoPtr transformMultiPolygon(
00148 const MultiPolygon* geom,
00149 const Geometry* parent);
00150
00151 virtual Geometry::AutoPtr transformGeometryCollection(
00152 const GeometryCollection* geom,
00153 const Geometry* parent);
00154
00155 private:
00156
00157 const Geometry* inputGeom;
00158
00159
00163 bool pruneEmptyGeometry;
00164
00170 bool preserveGeometryCollectionType;
00171
00175 bool preserveCollections;
00176
00180 bool preserveType;
00181
00182
00183 GeometryTransformer(const GeometryTransformer& other);
00184 GeometryTransformer& operator=(const GeometryTransformer& rhs);
00185 };
00186
00187
00188 }
00189 }
00190 }
00191
00192
00193
00194
00195
00196 #endif // GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212