00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_PRECISION_GEOMETRYSNAPPER_H
00022 #define GEOS_PRECISION_GEOMETRYSNAPPER_H
00023
00024 #include <geos/geom/Coordinate.h>
00025
00026 #include <memory>
00027 #include <vector>
00028
00029
00030 namespace geos {
00031 namespace geom {
00032
00033 class Geometry;
00034 class CoordinateSequence;
00035 }
00036 }
00037
00038 namespace geos {
00039 namespace precision {
00040
00045 class GeometrySnapper {
00046
00047 public:
00048
00049 GeometrySnapper(const geom::Geometry& g)
00050 :
00051 srcGeom(g)
00052 {
00053 }
00054
00064 std::auto_ptr<geom::Geometry> snapTo(const geom::Geometry& g, double snapTolerance);
00065
00073 static double computeOverlaySnapTolerance(const geom::Geometry& g);
00074
00075 static double computeSizeBasedSnapTolerance(const geom::Geometry& g);
00076
00080 static double computeOverlaySnapTolerance(const geom::Geometry& g1,
00081 const geom::Geometry& g2);
00082
00083
00084 private:
00085
00086
00087
00088
00089 static const double snapPrecisionFactor;
00090
00091 const geom::Geometry& srcGeom;
00092
00094 std::auto_ptr<geom::Coordinate::ConstVect> extractTargetCoordinates(
00095 const geom::Geometry& g);
00096 };
00097
00098
00099 }
00100 }
00101
00102 #endif // GEOS_PRECISION_GEOMETRYSNAPPER_H
00103
00104
00105
00106
00107
00108
00109
00110