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

#include <LineBuilder.h>

Collaboration diagram for geos::operation::overlayng::LineBuilder:
[legend]

Public Member Functions

 LineBuilder (const InputGeometry *inputGeom, OverlayGraph *p_graph, bool p_hasResultArea, int p_opCode, const geom::GeometryFactory *geomFact)
 
 LineBuilder (const LineBuilder &)=delete
 
LineBuilderoperator= (const LineBuilder &)=delete
 
std::vector< std::unique_ptr< geom::LineString > > getLines ()
 
void setStrictMode (bool p_isStrictResultMode)
 

Private Member Functions

void markResultLines ()
 
bool isResultLine (const OverlayLabel *lbl) const
 
geom::Location effectiveLocation (const OverlayLabel *lbl, int geomIndex) const
 
void addResultLines ()
 
void addResultLinesMerged ()
 
std::unique_ptr< geom::LineStringtoLine (OverlayEdge *edge)
 
void addResultLinesForNodes ()
 
void addResultLinesRings ()
 
std::unique_ptr< geom::LineStringbuildLine (OverlayEdge *node)
 
OverlayEdgenextLineEdgeUnvisited (OverlayEdge *node) const
 
int degreeOfLines (OverlayEdge *node) const
 

Private Attributes

OverlayGraphgraph
 
int opCode
 
const geom::GeometryFactorygeometryFactory
 
bool hasResultArea
 
int inputAreaIndex
 
std::vector< std::unique_ptr< geom::LineString > > lines
 
bool isAllowMixedResult = ! OverlayNG::STRICT_MODE_DEFAULT
 
bool isAllowCollapseLines = ! OverlayNG::STRICT_MODE_DEFAULT
 

Detailed Description

Finds and builds overlay result lines from the overlay graph. Output linework has the following semantics:

Various strategies are possible for how to merge graph edges into lines. This implementation uses the approach of having output lines run contiguously from node to node. For rings a node point is chosen arbitrarily.

Another possible strategy would be to preserve input linework as far as possible (i.e. any sections of input lines which are not coincident with other linework would be preserved).

It would also be possible to output LinearRings, if the input is a LinearRing and is unchanged. This will require additional info from the input linework.

Author
Martin Davis

Definition at line 70 of file g/LineBuilder.h.

Constructor & Destructor Documentation

geos::operation::overlayng::LineBuilder::LineBuilder ( const InputGeometry inputGeom,
OverlayGraph p_graph,
bool  p_hasResultArea,
int  p_opCode,
const geom::GeometryFactory geomFact 
)
inline

Definition at line 163 of file g/LineBuilder.h.

geos::operation::overlayng::LineBuilder::LineBuilder ( const LineBuilder )
delete

Member Function Documentation

void geos::operation::overlayng::LineBuilder::addResultLines ( )
private
void geos::operation::overlayng::LineBuilder::addResultLinesForNodes ( )
private
void geos::operation::overlayng::LineBuilder::addResultLinesMerged ( )
private
void geos::operation::overlayng::LineBuilder::addResultLinesRings ( )
private

Adds lines which form rings (i.e. have only degree-2 vertices).

std::unique_ptr<geom::LineString> geos::operation::overlayng::LineBuilder::buildLine ( OverlayEdge node)
private

Traverses edges from edgeStart which lie in a single line (have degree = 2).

The direction of the linework is preserved as far as possible. Specifically, the direction of the line is determined by the start edge direction. This implies that if all edges are reversed, the created line will be reversed to match. (Other more complex strategies would be possible. E.g. using the direction of the majority of segments, or preferring the direction of the A edges.)

int geos::operation::overlayng::LineBuilder::degreeOfLines ( OverlayEdge node) const
private

Computes the degree of the line edges incident on a node

geom::Location geos::operation::overlayng::LineBuilder::effectiveLocation ( const OverlayLabel lbl,
int  geomIndex 
) const
private

Determines the effective location for a line, for the purpose of overlay operation evaluation. Line edges and Collapses are reported as INTERIOR so they may be included in the result if warranted by the effect of the operation on the two edges. (For instance, the intersection of line edge and a collapsed boundary is included in the result).

std::vector<std::unique_ptr<geom::LineString> > geos::operation::overlayng::LineBuilder::getLines ( )
bool geos::operation::overlayng::LineBuilder::isResultLine ( const OverlayLabel lbl) const
private

Checks if the topology indicated by an edge label determines that this edge should be part of a result line.

Note that the logic here relies on the semantic that for intersection lines are only returned if there is no result area components.

void geos::operation::overlayng::LineBuilder::markResultLines ( )
private
OverlayEdge* geos::operation::overlayng::LineBuilder::nextLineEdgeUnvisited ( OverlayEdge node) const
private
LineBuilder& geos::operation::overlayng::LineBuilder::operator= ( const LineBuilder )
delete
void geos::operation::overlayng::LineBuilder::setStrictMode ( bool  p_isStrictResultMode)
inline

Definition at line 178 of file g/LineBuilder.h.

std::unique_ptr<geom::LineString> geos::operation::overlayng::LineBuilder::toLine ( OverlayEdge edge)
private

Member Data Documentation

const geom::GeometryFactory* geos::operation::overlayng::LineBuilder::geometryFactory
private

Definition at line 77 of file g/LineBuilder.h.

OverlayGraph* geos::operation::overlayng::LineBuilder::graph
private

Definition at line 75 of file g/LineBuilder.h.

bool geos::operation::overlayng::LineBuilder::hasResultArea
private

Definition at line 78 of file g/LineBuilder.h.

int geos::operation::overlayng::LineBuilder::inputAreaIndex
private

Definition at line 79 of file g/LineBuilder.h.

bool geos::operation::overlayng::LineBuilder::isAllowCollapseLines = ! OverlayNG::STRICT_MODE_DEFAULT
private

Allow lines created by area topology collapses to appear in the result. True provides the original JTS semantics.

Definition at line 95 of file g/LineBuilder.h.

bool geos::operation::overlayng::LineBuilder::isAllowMixedResult = ! OverlayNG::STRICT_MODE_DEFAULT
private

Indicates whether intersections are allowed to produce heterogeneous results including proper boundary touches. This does not control inclusion of touches along collapses. True provides the original JTS semantics.

Definition at line 88 of file g/LineBuilder.h.

std::vector<std::unique_ptr<geom::LineString> > geos::operation::overlayng::LineBuilder::lines
private

Definition at line 80 of file g/LineBuilder.h.

int geos::operation::overlayng::LineBuilder::opCode
private

Definition at line 76 of file g/LineBuilder.h.


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