geos::coverage::CoverageSimplifier Class Reference

`#include <CoverageSimplifier.h>`

## Public Member Functions

| CoverageSimplifier (const 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:

- It has the same number and types of polygonal geometries as the input
- Node points (inner vertices shared by three or more polygons, or boundary vertices shared by two or more) are not changed
- If the input is a valid coverage, then so is the result

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 | ( | const std::vector< const Geometry * > & | coverage | ) |

Create a new coverage simplifier instance.

Parameters

  coverage | a set of polygonal geometries forming a coverage

## Member Function Documentation

## simplify() [1/2]

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

Computes the simplified coverage, preserving the coverage topology.

Parameters

  tolerance | the simplification tolerance

Returns
  the simplified polygons

## simplify() [2/2]

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

  coverage | a set of polygonal geometries forming a coverage
  tolerance | the simplification tolerance

Returns
  the simplified polygons

References simplify().

Referenced by simplify().

## simplifyInner() [1/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

  tolerance | the simplification tolerance

Returns
  the simplified polygons

## simplifyInner() [2/2]

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

  coverage | a set of polygonal geometries forming a coverage
  tolerance | the simplification tolerance

Returns
  the simplified polygons

References simplifyInner().

Referenced by simplifyInner().

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

- CoverageSimplifier.h