GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::operation::linemerge::LineMerger Class Reference

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

#include <LineMerger.h>

Collaboration diagram for geos::operation::linemerge::LineMerger:
[legend]

Public Member Functions

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

Private Member Functions

void merge ()
 
void buildEdgeStringsForObviousStartNodes ()
 
void buildEdgeStringsForIsolatedLoops ()
 
void buildEdgeStringsForUnprocessedNodes ()
 
void buildEdgeStringsForNonDegree2Nodes ()
 
void buildEdgeStringsStartingAt (planargraph::Node *node)
 
EdgeStringbuildEdgeStringStartingWith (LineMergeDirectedEdge *start)
 

Private Attributes

LineMergeGraph graph
 
std::vector< std::unique_ptr< geom::LineString > > mergedLineStrings
 
std::vector< EdgeString * > edgeStrings
 
const geom::GeometryFactoryfactory
 

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.

Definition at line 76 of file LineMerger.h.

Constructor & Destructor Documentation

geos::operation::linemerge::LineMerger::LineMerger ( )
geos::operation::linemerge::LineMerger::~LineMerger ( )
geos::operation::linemerge::LineMerger::LineMerger ( const LineMerger other)
delete

Member Function Documentation

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.

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.

void geos::operation::linemerge::LineMerger::add ( const geom::LineString lineString)
void geos::operation::linemerge::LineMerger::buildEdgeStringsForIsolatedLoops ( )
private
void geos::operation::linemerge::LineMerger::buildEdgeStringsForNonDegree2Nodes ( )
private
void geos::operation::linemerge::LineMerger::buildEdgeStringsForObviousStartNodes ( )
private
void geos::operation::linemerge::LineMerger::buildEdgeStringsForUnprocessedNodes ( )
private
void geos::operation::linemerge::LineMerger::buildEdgeStringsStartingAt ( planargraph::Node node)
private
EdgeString* geos::operation::linemerge::LineMerger::buildEdgeStringStartingWith ( LineMergeDirectedEdge start)
private
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.

void geos::operation::linemerge::LineMerger::merge ( )
private
LineMerger& geos::operation::linemerge::LineMerger::operator= ( const LineMerger rhs)
delete

Member Data Documentation

std::vector<EdgeString*> geos::operation::linemerge::LineMerger::edgeStrings
private

Definition at line 84 of file LineMerger.h.

const geom::GeometryFactory* geos::operation::linemerge::LineMerger::factory
private

Definition at line 86 of file LineMerger.h.

LineMergeGraph geos::operation::linemerge::LineMerger::graph
private

Definition at line 80 of file LineMerger.h.

std::vector<std::unique_ptr<geom::LineString> > geos::operation::linemerge::LineMerger::mergedLineStrings
private

Definition at line 82 of file LineMerger.h.


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