00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00021 #define GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00022
00023 #include <geos/export.h>
00024 #include <vector>
00025 #include <memory>
00026
00027
00028 namespace geos {
00029 namespace geom {
00030 class Coordinate;
00031 }
00032 }
00033
00034 namespace geos {
00035 namespace simplify {
00036
00041 class GEOS_DLL DouglasPeuckerLineSimplifier {
00042
00043 public:
00044
00045 typedef std::vector<short int> BoolVect;
00046 typedef std::auto_ptr<BoolVect> BoolVectAutoPtr;
00047
00048 typedef std::vector<geom::Coordinate> CoordsVect;
00049 typedef std::auto_ptr<CoordsVect> CoordsVectAutoPtr;
00050
00051
00056 static CoordsVectAutoPtr simplify(
00057 const CoordsVect& nPts,
00058 double distanceTolerance);
00059
00060 DouglasPeuckerLineSimplifier(const CoordsVect& nPts);
00061
00070 void setDistanceTolerance(double nDistanceTolerance);
00071
00076 CoordsVectAutoPtr simplify();
00077
00078 private:
00079
00080 const CoordsVect& pts;
00081 BoolVectAutoPtr usePt;
00082 double distanceTolerance;
00083
00084 void simplifySection(size_t i, size_t j);
00085
00086
00087 DouglasPeuckerLineSimplifier(const DouglasPeuckerLineSimplifier& other);
00088 DouglasPeuckerLineSimplifier& operator=(const DouglasPeuckerLineSimplifier& rhs);
00089 };
00090
00091 }
00092 }
00093
00094 #endif // GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110