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 #include <geos/geom/Coordinate.h>
00024 #include <geos/geom/Geometry.h>
00025 #include <geos/geom/CoordinateSequence.h>
00026
00027 #include <memory>
00028 #include <vector>
00029
00030
00031 namespace geos {
00032 namespace geom {
00033 class Geometry;
00034 class GeometryFactory;
00035 class Point;
00036 class LinearRing;
00037 class LineString;
00038 class Polygon;
00039 class MultiPoint;
00040 class MultiPolygon;
00041 class MultiLineString;
00042 class GeometryCollection;
00043 namespace util {
00044
00045 }
00046 }
00047 }
00048
00049
00050 namespace geos {
00051 namespace geom {
00052 namespace util {
00053
00090 class GeometryTransformer {
00091
00092 public:
00093
00094 GeometryTransformer();
00095
00096 virtual ~GeometryTransformer();
00097
00098 std::auto_ptr<Geometry> transform(const Geometry* nInputGeom);
00099
00100 protected:
00101
00102 const GeometryFactory* factory;
00103
00113 CoordinateSequence::AutoPtr createCoordinateSequence(
00114 std::auto_ptr< std::vector<Coordinate> > coords);
00115
00116 virtual CoordinateSequence::AutoPtr transformCoordinates(
00117 const CoordinateSequence* coords,
00118 const Geometry* parent);
00119
00120 virtual Geometry::AutoPtr transformPoint(
00121 const Point* geom,
00122 const Geometry* parent);
00123
00124 virtual Geometry::AutoPtr transformMultiPoint(
00125 const MultiPoint* geom,
00126 const Geometry* parent);
00127
00128 virtual Geometry::AutoPtr transformLinearRing(
00129 const LinearRing* geom,
00130 const Geometry* parent);
00131
00132 virtual Geometry::AutoPtr transformLineString(
00133 const LineString* geom,
00134 const Geometry* parent);
00135
00136 virtual Geometry::AutoPtr transformMultiLineString(
00137 const MultiLineString* geom,
00138 const Geometry* parent);
00139
00140 virtual Geometry::AutoPtr transformPolygon(
00141 const Polygon* geom,
00142 const Geometry* parent);
00143
00144 virtual Geometry::AutoPtr transformMultiPolygon(
00145 const MultiPolygon* geom,
00146 const Geometry* parent);
00147
00148 virtual Geometry::AutoPtr transformGeometryCollection(
00149 const GeometryCollection* geom,
00150 const Geometry* parent);
00151
00152 private:
00153
00154 const Geometry* inputGeom;
00155
00156
00160 bool pruneEmptyGeometry;
00161
00167 bool preserveGeometryCollectionType;
00168
00172 bool preserveCollections;
00173
00177 bool preserveType;
00178
00179
00180 };
00181
00182
00183 }
00184 }
00185 }
00186
00187
00188
00189
00190
00191 #endif // GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207