GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::noding::NodingIntersectionFinder Class Reference

Finds non-noded intersections in a set of SegmentStrings, if any exist. More...

#include <NodingIntersectionFinder.h>

Inheritance diagram for geos::noding::NodingIntersectionFinder:
[legend]
Collaboration diagram for geos::noding::NodingIntersectionFinder:
[legend]

Public Member Functions

 NodingIntersectionFinder (algorithm::LineIntersector &newLi)
 Creates an intersection finder which finds an interior intersection if one exists. More...
 
bool hasIntersection () const
 Tests whether an intersection was found. More...
 
const geom::CoordinategetInteriorIntersection () const
 Gets the computed location of the intersection. Due to round-off, the location may not be exact. More...
 
size_t count () const
 Gets the count of intersections found. More...
 
void setCheckEndSegmentsOnly (bool isCESO)
 Sets whether only end segments should be tested for interior intersection. More...
 
void setFindAllIntersections (bool fAI)
 Sets whether all intersections should be computed. More...
 
const std::vector< geom::Coordinate > & getIntersectionSegments () const
 Gets the endpoints of the intersecting segments. More...
 
void processIntersections (SegmentString *e0, size_t segIndex0, SegmentString *e1, size_t segIndex1) override
 This method is called by clients of the SegmentIntersector class to process intersections for two segments of the SegmentStrings being intersected. More...
 
bool isDone () const override
 Reports whether the client of this class needs to continue testing all intersections in an arrangement. More...
 
- Public Member Functions inherited from geos::noding::SegmentIntersector
virtual ~SegmentIntersector ()
 

Private Member Functions

 NodingIntersectionFinder (const NodingIntersectionFinder &other)=delete
 
NodingIntersectionFinderoperator= (const NodingIntersectionFinder &rhs)=delete
 
bool isInteriorVertexIntersection (const geom::Coordinate &p0, const geom::Coordinate &p1, bool isEnd0, bool isEnd1)
 Tests if two vertices with at least one in a segmentString interior are equal. More...
 
bool isInteriorVertexIntersection (const geom::Coordinate &p00, const geom::Coordinate &p01, const geom::Coordinate &p10, const geom::Coordinate &p11, bool isEnd00, bool isEnd01, bool isEnd10, bool isEnd11)
 Tests if an intersection occurs between a SegmentString interior vertex and another vertex. More...
 
bool isEndSegment (const SegmentString *segStr, size_t index)
 Tests whether a segment in a SegmentString is an end segment. (either the first or last). More...
 

Private Attributes

algorithm::LineIntersectorli
 
geom::Coordinate interiorIntersection
 
size_t intersectionCount
 
bool isCheckEndSegmentsOnly
 
bool findAllIntersections
 
std::vector< geom::CoordinateintSegments
 

Additional Inherited Members

- Protected Member Functions inherited from geos::noding::SegmentIntersector
 SegmentIntersector ()
 

Detailed Description

Finds non-noded intersections in a set of SegmentStrings, if any exist.

Non-noded intersections include:

Version
1.7

Definition at line 47 of file NodingIntersectionFinder.h.

Constructor & Destructor Documentation

geos::noding::NodingIntersectionFinder::NodingIntersectionFinder ( algorithm::LineIntersector newLi)
inline

Creates an intersection finder which finds an interior intersection if one exists.

Parameters
newLithe LineIntersector to use

Definition at line 57 of file NodingIntersectionFinder.h.

geos::noding::NodingIntersectionFinder::NodingIntersectionFinder ( const NodingIntersectionFinder other)
privatedelete

Member Function Documentation

size_t geos::noding::NodingIntersectionFinder::count ( ) const
inline

Gets the count of intersections found.

Returns
the intersection count

Definition at line 96 of file NodingIntersectionFinder.h.

const geom::Coordinate& geos::noding::NodingIntersectionFinder::getInteriorIntersection ( ) const
inline

Gets the computed location of the intersection. Due to round-off, the location may not be exact.

Returns
the coordinate for the intersection location

Definition at line 85 of file NodingIntersectionFinder.h.

const std::vector<geom::Coordinate>& geos::noding::NodingIntersectionFinder::getIntersectionSegments ( ) const
inline

Gets the endpoints of the intersecting segments.

Returns
an array of the segment endpoints (p00, p01, p10, p11)

Definition at line 140 of file NodingIntersectionFinder.h.

bool geos::noding::NodingIntersectionFinder::hasIntersection ( ) const
inline

Tests whether an intersection was found.

Returns
true if an intersection was found

Definition at line 73 of file NodingIntersectionFinder.h.

bool geos::noding::NodingIntersectionFinder::isDone ( ) const
inlineoverridevirtual

Reports whether the client of this class needs to continue testing all intersections in an arrangement.

Returns
true if there is not need to continue testing segments

The default implementation always return false (process all intersections).

Reimplemented from geos::noding::SegmentIntersector.

Definition at line 159 of file NodingIntersectionFinder.h.

bool geos::noding::NodingIntersectionFinder::isEndSegment ( const SegmentString segStr,
size_t  index 
)
private

Tests whether a segment in a SegmentString is an end segment. (either the first or last).

Parameters
segStra segment string
indexthe index of a segment in the segment string
Returns
true if the segment is an end segment
bool geos::noding::NodingIntersectionFinder::isInteriorVertexIntersection ( const geom::Coordinate p0,
const geom::Coordinate p1,
bool  isEnd0,
bool  isEnd1 
)
private

Tests if two vertices with at least one in a segmentString interior are equal.

Parameters
p0a segment vertex
p1a segment vertex
isEnd0true if vertex is a segmentString endpoint
isEnd1true if vertex is a segmentString endpoint
Returns
true if an intersection is found
bool geos::noding::NodingIntersectionFinder::isInteriorVertexIntersection ( const geom::Coordinate p00,
const geom::Coordinate p01,
const geom::Coordinate p10,
const geom::Coordinate p11,
bool  isEnd00,
bool  isEnd01,
bool  isEnd10,
bool  isEnd11 
)
private

Tests if an intersection occurs between a SegmentString interior vertex and another vertex.

Note
intersections between two endpoint vertices are valid noding, and are not flagged.
Parameters
p00a segment vertex
p01a segment vertex
p10a segment vertex
p11a segment vertex
isEnd00true if vertex is a segmentString endpoint
isEnd01true if vertex is a segmentString endpoint
isEnd10true if vertex is a segmentString endpoint
isEnd11true if vertex is a segmentString endpoint
Returns
true if an intersection is found
NodingIntersectionFinder& geos::noding::NodingIntersectionFinder::operator= ( const NodingIntersectionFinder rhs)
privatedelete
void geos::noding::NodingIntersectionFinder::processIntersections ( SegmentString e0,
size_t  segIndex0,
SegmentString e1,
size_t  segIndex1 
)
overridevirtual

This method is called by clients of the SegmentIntersector class to process intersections for two segments of the SegmentStrings being intersected.

Note
Some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).

Implements geos::noding::SegmentIntersector.

void geos::noding::NodingIntersectionFinder::setCheckEndSegmentsOnly ( bool  isCESO)
inline

Sets whether only end segments should be tested for interior intersection.

This is a performance optimization that may be used if the segments have been previously noded by an appropriate algorithm. It may be known that any potential noding failures will occur only in end segments.

Parameters
isCESOwhether to test only end segments

Definition at line 112 of file NodingIntersectionFinder.h.

void geos::noding::NodingIntersectionFinder::setFindAllIntersections ( bool  fAI)
inline

Sets whether all intersections should be computed.

When this is false (the default value) the value of isDone() is true after the first intersection is found.

Default is false.

Parameters
fAIwhether all intersections should be computed

Definition at line 129 of file NodingIntersectionFinder.h.

Member Data Documentation

bool geos::noding::NodingIntersectionFinder::findAllIntersections
private

Definition at line 169 of file NodingIntersectionFinder.h.

geom::Coordinate geos::noding::NodingIntersectionFinder::interiorIntersection
private

Definition at line 166 of file NodingIntersectionFinder.h.

size_t geos::noding::NodingIntersectionFinder::intersectionCount
private

Definition at line 167 of file NodingIntersectionFinder.h.

std::vector<geom::Coordinate> geos::noding::NodingIntersectionFinder::intSegments
private

Definition at line 170 of file NodingIntersectionFinder.h.

bool geos::noding::NodingIntersectionFinder::isCheckEndSegmentsOnly
private

Definition at line 168 of file NodingIntersectionFinder.h.

algorithm::LineIntersector& geos::noding::NodingIntersectionFinder::li
private

Definition at line 165 of file NodingIntersectionFinder.h.


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