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 void setSkipTransformedInvalidInteriorRings(bool b);
00103
00104 protected:
00105
00106 const GeometryFactory* factory;
00107
00117 CoordinateSequence::AutoPtr createCoordinateSequence(
00118 std::auto_ptr< std::vector<Coordinate> > coords);
00119
00120 virtual CoordinateSequence::AutoPtr transformCoordinates(
00121 const CoordinateSequence* coords,
00122 const Geometry* parent);
00123
00124 virtual Geometry::AutoPtr transformPoint(
00125 const Point* geom,
00126 const Geometry* parent);
00127
00128 virtual Geometry::AutoPtr transformMultiPoint(
00129 const MultiPoint* geom,
00130 const Geometry* parent);
00131
00132 virtual Geometry::AutoPtr transformLinearRing(
00133 const LinearRing* geom,
00134 const Geometry* parent);
00135
00136 virtual Geometry::AutoPtr transformLineString(
00137 const LineString* geom,
00138 const Geometry* parent);
00139
00140 virtual Geometry::AutoPtr transformMultiLineString(
00141 const MultiLineString* geom,
00142 const Geometry* parent);
00143
00144 virtual Geometry::AutoPtr transformPolygon(
00145 const Polygon* geom,
00146 const Geometry* parent);
00147
00148 virtual Geometry::AutoPtr transformMultiPolygon(
00149 const MultiPolygon* geom,
00150 const Geometry* parent);
00151
00152 virtual Geometry::AutoPtr transformGeometryCollection(
00153 const GeometryCollection* geom,
00154 const Geometry* parent);
00155
00156 private:
00157
00158 const Geometry* inputGeom;
00159
00160
00164 bool pruneEmptyGeometry;
00165
00171 bool preserveGeometryCollectionType;
00172
00176 bool preserveCollections;
00177
00181 bool preserveType;
00182
00186 bool skipTransformedInvalidInteriorRings;
00187
00188
00189 GeometryTransformer(const GeometryTransformer& other);
00190 GeometryTransformer& operator=(const GeometryTransformer& rhs);
00191 };
00192
00193
00194 }
00195 }
00196 }
00197
00198 #endif // GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H