Class SnappingNoder
java.lang.Object
org.locationtech.jts.noding.snap.SnappingNoder
- All Implemented Interfaces:
Noder
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
.invalid reference
ValidatingNoder
- Version:
- 1.17
-
Constructor Summary
ConstructorsConstructorDescriptionSnappingNoder(double snapTolerance) Creates a snapping noder using the given snap distance tolerance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeNodes(Collection inputSegStrings) Computes the noding for a collection ofSegmentStrings.Returns aCollectionof fully nodedSegmentStrings.
-
Constructor Details
-
SnappingNoder
public SnappingNoder(double snapTolerance) Creates a snapping noder using the given snap distance tolerance.- Parameters:
snapTolerance- points are snapped if within this distance
-
-
Method Details
-
getNodedSubstrings
Description copied from interface:NoderReturns aCollectionof fully nodedSegmentStrings. The SegmentStrings have the same context as their parent.- Specified by:
getNodedSubstringsin interfaceNoder- Returns:
- a Collection of NodedSegmentStrings representing the substrings
-
computeNodes
Description copied from interface:NoderComputes the noding for a collection ofSegmentStrings. Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.- Specified by:
computeNodesin interfaceNoder- Parameters:
inputSegStrings- a Collection of SegmentStrings
-