geos::operation::linemerge::LineMerger Class Reference

Sews together a set of fully noded LineStrings. More...

`#include <LineMerger.h>`

## Public Member Functions

| LineMerger (bool directed=false)
void | add (std::vector< const geom::Geometry * > *geometries)
| Adds a collection of Geometries to be processed. May be called multiple times.
void | add (const geom::Geometry *geometry)
| Adds a Geometry to be processed. May be called multiple times.
std::vector< std::unique_ptr< geom::LineString > > | getMergedLineStrings ()
| Returns the LineStrings built by the merging process.
void | add (const geom::LineString *lineString)
| LineMerger (const LineMerger &other)=delete
LineMerger & | operator= (const LineMerger &rhs)=delete

## Detailed Description

Sews together a set of fully noded LineStrings.

Sewing stops at nodes of degree 1 or 3 or more. The exception is an isolated loop, which only has degree-2 nodes, in which case a node is simply chosen as a starting point. The direction of each merged LineString will be that of the majority of the LineStrings from which it was derived.

Any dimension of Geometry is handled. The constituent linework is extracted to form the edges. The edges must be correctly noded; that is, they must only meet at their endpoints.

The LineMerger will still run on incorrectly noded input but will not form polygons from incorrected noded edges.

## Member Function Documentation

## add() [1/2]

void geos::operation::linemerge::LineMerger::add | ( | const geom::Geometry * | geometry | ) |

Adds a Geometry to be processed. May be called multiple times.

Any dimension of Geometry may be added; the constituent linework will be extracted.

## add() [2/2]

void geos::operation::linemerge::LineMerger::add | ( | std::vector< const geom::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.

Referenced by getMergedLineStrings().

## getMergedLineStrings()

std::vector< std::unique_ptr< geom::LineString > > geos::operation::linemerge::LineMerger::getMergedLineStrings | ( |  | ) |

Returns the LineStrings built by the merging process.

Ownership of vector and its elements to caller.

References add().

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

- LineMerger.h