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 <vector>
00024 #include <memory>
00025
00026
00027 namespace geos {
00028 namespace geom {
00029 class Coordinate;
00030 }
00031 }
00032
00033 namespace geos {
00034 namespace simplify {
00035
00040 class DouglasPeuckerLineSimplifier {
00041
00042 public:
00043
00044 typedef std::vector<short int> BoolVect;
00045 typedef std::auto_ptr<BoolVect> BoolVectAutoPtr;
00046
00047 typedef std::vector<geom::Coordinate> CoordsVect;
00048 typedef std::auto_ptr<CoordsVect> CoordsVectAutoPtr;
00049
00050
00055 static CoordsVectAutoPtr simplify(
00056 const CoordsVect& nPts,
00057 double distanceTolerance);
00058
00059 DouglasPeuckerLineSimplifier(const CoordsVect& nPts);
00060
00069 void setDistanceTolerance(double nDistanceTolerance);
00070
00075 CoordsVectAutoPtr simplify();
00076
00077 private:
00078
00079 const CoordsVect& pts;
00080 BoolVectAutoPtr usePt;
00081 double distanceTolerance;
00082
00083 void simplifySection(size_t i, size_t j);
00084 };
00085
00086 }
00087 }
00088
00089 #endif // _GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H_
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105