GEOS  3.12.0
Public Member Functions | Static Public Member Functions | List of all members
geos::coverage::CoverageSimplifier Class Reference

#include <CoverageSimplifier.h>

Public Member Functions

 CoverageSimplifier (std::vector< const Geometry *> &coverage)
 
std::vector< std::unique_ptr< Geometry > > simplify (double tolerance)
 
std::vector< std::unique_ptr< Geometry > > simplifyInner (double tolerance)
 

Static Public Member Functions

static std::vector< std::unique_ptr< Geometry > > simplify (std::vector< const Geometry *> &coverage, double tolerance)
 
static std::vector< std::unique_ptr< Geometry > > simplify (const std::vector< std::unique_ptr< Geometry >> &coverage, double tolerance)
 
static std::vector< std::unique_ptr< Geometry > > simplifyInner (std::vector< const Geometry *> &coverage, double tolerance)
 
static std::vector< std::unique_ptr< Geometry > > simplifyInner (const std::vector< std::unique_ptr< Geometry >> &coverage, double tolerance)
 

Detailed Description

Simplifies the boundaries of the polygons in a polygonal coverage while preserving the original coverage topology. An area-based simplification algorithm (similar to Visvalingam-Whyatt simplification) is used to provide high-quality results. Also supports simplifying just the inner edges in a coverage, which allows simplifying "patches" without affecting their boundary.

The amount of simplification is determined by a tolerance value, which is a non-negative quantity. It equates roughly to the maximum distance by which a simplified line can change from the original. (In fact, it is the square root of the area tolerance used in the Visvalingam-Whyatt algorithm.)

The simplified result coverage has the following characteristics:

This class also supports inner simplification, which simplifies only edges of the coverage which are adjacent to two polygons. This allows partial simplification of a coverage, since a simplified subset of a coverage still matches the remainder of the coverage.

The input coverage should be valid according to CoverageValidator.

Author
Martin Davis

Constructor & Destructor Documentation

◆ CoverageSimplifier()

geos::coverage::CoverageSimplifier::CoverageSimplifier ( std::vector< const Geometry *> &  coverage)

Create a new coverage simplifier instance.

Parameters
coveragea set of polygonal geometries forming a coverage

Member Function Documentation

◆ simplify() [1/2]

static std::vector<std::unique_ptr<Geometry> > geos::coverage::CoverageSimplifier::simplify ( std::vector< const Geometry *> &  coverage,
double  tolerance 
)
static

Simplifies the boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology.

Parameters
coveragea set of polygonal geometries forming a coverage
tolerancethe simplification tolerance
Returns
the simplified polygons

◆ simplify() [2/2]

std::vector<std::unique_ptr<Geometry> > geos::coverage::CoverageSimplifier::simplify ( double  tolerance)

Computes the simplified coverage, preserving the coverage topology.

Parameters
tolerancethe simplification tolerance
Returns
the simplified polygons

◆ simplifyInner() [1/2]

static std::vector<std::unique_ptr<Geometry> > geos::coverage::CoverageSimplifier::simplifyInner ( std::vector< const Geometry *> &  coverage,
double  tolerance 
)
static

Simplifies the inner boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology. Edges which form the exterior boundary of the coverage are left unchanged.

Parameters
coveragea set of polygonal geometries forming a coverage
tolerancethe simplification tolerance
Returns
the simplified polygons

◆ simplifyInner() [2/2]

std::vector<std::unique_ptr<Geometry> > geos::coverage::CoverageSimplifier::simplifyInner ( double  tolerance)

Computes the inner-boundary simplified coverage, preserving the coverage topology, and leaving outer boundary edges unchanged.

Parameters
tolerancethe simplification tolerance
Returns
the simplified polygons

The documentation for this class was generated from the following file: