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