geos::dissolve::LineDissolver Class Reference

`#include <LineDissolver.h>`

## Public Member Functions

void | add (const Geometry *geometry)
void | add (std::vector< const Geometry * > geometries)
void | add (const LineString *lineString)
std::unique_ptr< Geometry > | getResult ()
| LineDissolver (const LineDissolver &)=delete
LineDissolver & | operator= (const LineDissolver &)=delete

## Static Public Member Functions

static std::unique_ptr< Geometry > | dissolve (const Geometry *g)

## Detailed Description

Dissolves the linear components from a collection of Geometry into a set of maximal-length LineString in which every unique segment appears once only. The output linestrings run between node vertices of the input, which are vertices which have either degree 1, or degree 3 or greater.

Use cases for dissolving linear components include generalization (in particular, simplifying polygonal coverages), and visualization (in particular, avoiding symbology conflicts when depicting shared polygon boundaries).

This class does not node the input lines. If there are line segments crossing in the input, they will still cross in the output.

Author
  Martin Davis

## Constructor & Destructor Documentation

## LineDissolver()

geos::dissolve::LineDissolver::LineDissolver | ( | const LineDissolver & |  | ) |

delete

Disable copy construction and assignment. Needed to make this class compile under MSVC, because it has a vector<unique_ptr> as a member. (See https://stackoverflow.com/q/29565299)

## Member Function Documentation

## add() [1/2]

void geos::dissolve::LineDissolver::add | ( | const Geometry * | geometry | ) |

Adds a Geometry to be dissolved. Any number of geometries may be added by calling this method multiple times. Any type of Geometry may be added. The constituent linework will be extracted to be dissolved.

Parameters

  geometry | geometry to be line-merged

Referenced by add().

## add() [2/2]

void geos::dissolve::LineDissolver::add | ( | std::vector< const Geometry * > | geometries | ) |

Adds a collection of Geometries to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted.

Parameters

  geometries | the geometries to be line-merged

References add().

## dissolve()

std::unique_ptr< Geometry > geos::dissolve::LineDissolver::dissolve | ( | const Geometry * | g | ) |

static

Dissolves the linear components in a geometry.

Parameters

  g | the geometry to dissolve

Returns
  the dissolved lines

## getResult()

std::unique_ptr< Geometry > geos::dissolve::LineDissolver::getResult | ( |  | ) |

Gets the dissolved result as a MultiLineString.

Returns
  the dissolved lines

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

- LineDissolver.h