GEOS  3.14.0dev
DouglasPeuckerSimplifier.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: simplify/DouglasPeuckerSimplifier.java rev. 1.5 (JTS-1.7)
16  *
17  **********************************************************************/
18 
19 #pragma once
20 
21 #include <geos/export.h>
22 #include <memory> // for unique_ptr
23 
24 // Forward declarations
25 namespace geos {
26 namespace geom {
27 class Geometry;
28 }
29 }
30 
31 namespace geos {
32 namespace simplify { // geos::simplify
33 
34 
49 class GEOS_DLL DouglasPeuckerSimplifier {
50 
51 public:
52 
53  static std::unique_ptr<geom::Geometry> simplify(
54  const geom::Geometry* geom,
55  double tolerance);
56 
58 
69  void setDistanceTolerance(double tolerance);
70 
71  std::unique_ptr<geom::Geometry> getResultGeometry();
72 
73 
74 private:
75 
76  const geom::Geometry* inputGeom;
77 
78  double distanceTolerance;
79 };
80 
81 
82 } // namespace geos::simplify
83 } // namespace geos
84 
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Simplifies a Geometry using the standard Douglas-Peucker algorithm.
Definition: DouglasPeuckerSimplifier.h:49
void setDistanceTolerance(double tolerance)
Sets the distance tolerance for the simplification.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25