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

#include <SnapRoundingIntersectionAdder.h>

Inheritance diagram for geos::noding::snapround::SnapRoundingIntersectionAdder:
[legend]
Collaboration diagram for geos::noding::snapround::SnapRoundingIntersectionAdder:
[legend]

Public Member Functions

 SnapRoundingIntersectionAdder (const geom::PrecisionModel *newPm)
 
std::unique_ptr< std::vector< geom::Coordinate > > getIntersections ()
 
void processIntersections (SegmentString *e0, size_t segIndex0, SegmentString *e1, size_t segIndex1) override
 
bool isDone () const override
 
- Public Member Functions inherited from geos::noding::SegmentIntersector
virtual ~SegmentIntersector ()
 

Private Member Functions

void processNearVertex (const geom::Coordinate &p, SegmentString *edge, size_t segIndex, const geom::Coordinate &p0, const geom::Coordinate &p1)
 

Private Attributes

algorithm::LineIntersector li
 
std::unique_ptr< std::vector< geom::Coordinate > > intersections
 
double nearnessTol
 

Static Private Attributes

static constexpr int NEARNESS_FACTOR = 100
 

Additional Inherited Members

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

Detailed Description

Finds intersections between line segments which will be snap-rounded, and adds them as nodes to the segments.

Intersections are detected and computed using full precision. Snapping takes place in a subsequent phase.

The intersection points are recorded, so that HotPixels can be created for them.

To avoid robustness issues with vertices which lie very close to line segments a heuristic is used: nodes are created if a vertex lies within a tolerance distance of the interior of a segment. The tolerance distance is chosen to be significantly below the snap-rounding grid size. This has empirically proven to eliminate noding failures.

Definition at line 65 of file SnapRoundingIntersectionAdder.h.

Constructor & Destructor Documentation

geos::noding::snapround::SnapRoundingIntersectionAdder::SnapRoundingIntersectionAdder ( const geom::PrecisionModel newPm)

Member Function Documentation

std::unique_ptr<std::vector<geom::Coordinate> > geos::noding::snapround::SnapRoundingIntersectionAdder::getIntersections ( )
inline

Definition at line 100 of file SnapRoundingIntersectionAdder.h.

bool geos::noding::snapround::SnapRoundingIntersectionAdder::isDone ( ) const
inlineoverridevirtual

Always process all intersections

Reimplemented from geos::noding::SegmentIntersector.

Definition at line 116 of file SnapRoundingIntersectionAdder.h.

void geos::noding::snapround::SnapRoundingIntersectionAdder::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 that 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::snapround::SnapRoundingIntersectionAdder::processNearVertex ( const geom::Coordinate p,
SegmentString edge,
size_t  segIndex,
const geom::Coordinate p0,
const geom::Coordinate p1 
)
private

If an endpoint of one segment is near the interior of the other segment, add it as an intersection. EXCEPT if the endpoint is also close to a segment endpoint (since this can introduce "zigs" in the linework).

This resolves situations where a segment A endpoint is extremely close to another segment B, but is not quite crossing. Due to robustness issues in orientation detection, this can result in the snapped segment A crossing segment B without a node being introduced.

Member Data Documentation

std::unique_ptr<std::vector<geom::Coordinate> > geos::noding::snapround::SnapRoundingIntersectionAdder::intersections
private

Definition at line 75 of file SnapRoundingIntersectionAdder.h.

algorithm::LineIntersector geos::noding::snapround::SnapRoundingIntersectionAdder::li
private

Definition at line 74 of file SnapRoundingIntersectionAdder.h.

constexpr int geos::noding::snapround::SnapRoundingIntersectionAdder::NEARNESS_FACTOR = 100
staticprivate

The division factor used to determine nearness distance tolerance for interior intersection detection.

Definition at line 72 of file SnapRoundingIntersectionAdder.h.

double geos::noding::snapround::SnapRoundingIntersectionAdder::nearnessTol
private

Definition at line 77 of file SnapRoundingIntersectionAdder.h.


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