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

#include <SnappingNoder.h>

Inheritance diagram for geos::noding::snap::SnappingNoder:
[legend]
Collaboration diagram for geos::noding::snap::SnappingNoder:
[legend]

Public Member Functions

 SnappingNoder (double p_snapTolerance)
 
std::vector< SegmentString * > * getNodedSubstrings () const override
 
void computeNodes (std::vector< SegmentString * > *inputSegStrings) override
 Computes the noding for a collection of SegmentStrings. More...
 
- Public Member Functions inherited from geos::noding::Noder
virtual ~Noder ()
 

Private Member Functions

void snapVertices (std::vector< SegmentString * > &segStrings, std::vector< SegmentString * > &nodedStrings)
 
SegmentStringsnapVertices (SegmentString *ss)
 
std::unique_ptr< std::vector< geom::Coordinate > > snap (geom::CoordinateSequence *cs)
 
std::unique_ptr< std::vector< SegmentString * > > snapIntersections (std::vector< SegmentString * > &inputSS)
 

Private Attributes

double snapTolerance
 
SnappingPointIndex snapIndex
 
std::vector< SegmentString * > * nodedResult
 

Additional Inherited Members

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

Detailed Description

Nodes a set of segment strings snapping vertices and intersection points together if they lie within the given snap tolerance distance. Vertices take priority over intersection points for snapping. Input segment strings are generally only split at true node points (i.e. the output segment strings are of maximal length in the output arrangement).

The snap tolerance should be chosen to be as small as possible while still producing a correct result. It probably only needs to be small enough to eliminate "nearly-coincident" segments, for which intersection points cannot be computed accurately. This implies a factor of about 10e-12 smaller than the magnitude of the segment coordinates.

With an appropriate snap tolerance this algorithm appears to be very robust. So far no failure cases have been found, given a small enough snap tolerance.

The correctness of the output is not verified by this noder. If required this can be done by noding::ValidatingNoder.

Definition at line 66 of file SnappingNoder.h.

Constructor & Destructor Documentation

geos::noding::snap::SnappingNoder::SnappingNoder ( double  p_snapTolerance)
inline

Creates a snapping noder using the given snap distance tolerance.

Parameters
p_snapTolerancepoints are snapped if within this distance

Definition at line 99 of file SnappingNoder.h.

Member Function Documentation

void geos::noding::snap::SnappingNoder::computeNodes ( std::vector< SegmentString * > *  segStrings)
overridevirtual

Computes the noding for a collection of SegmentStrings.

Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.

Parameters
segStringsa collection of SegmentStrings to node The caller remains responsible for releasing the memory associated with the container and its elements.

Implements geos::noding::Noder.

std::vector<SegmentString*>* geos::noding::snap::SnappingNoder::getNodedSubstrings ( ) const
overridevirtual
Returns
a Collection of NodedSegmentStrings representing the substrings

Implements geos::noding::Noder.

std::unique_ptr<std::vector<geom::Coordinate> > geos::noding::snap::SnappingNoder::snap ( geom::CoordinateSequence cs)
private
std::unique_ptr<std::vector<SegmentString*> > geos::noding::snap::SnappingNoder::snapIntersections ( std::vector< SegmentString * > &  inputSS)
private

Computes all interior intersections in the collection of SegmentStrings, and returns their Coordinates.

Also adds the intersection nodes to the segments.

Returns
a list of Coordinates for the intersections
void geos::noding::snap::SnappingNoder::snapVertices ( std::vector< SegmentString * > &  segStrings,
std::vector< SegmentString * > &  nodedStrings 
)
private
SegmentString* geos::noding::snap::SnappingNoder::snapVertices ( SegmentString ss)
private

Member Data Documentation

std::vector<SegmentString*>* geos::noding::snap::SnappingNoder::nodedResult
private

Definition at line 73 of file SnappingNoder.h.

SnappingPointIndex geos::noding::snap::SnappingNoder::snapIndex
private

Definition at line 72 of file SnappingNoder.h.

double geos::noding::snap::SnappingNoder::snapTolerance
private

Definition at line 71 of file SnappingNoder.h.


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