Class SnapRoundingIntersectionAdder
- java.lang.Object
-
- org.locationtech.jts.noding.snapround.SnapRoundingIntersectionAdder
-
- All Implemented Interfaces:
SegmentIntersector
public class SnapRoundingIntersectionAdder extends java.lang.Object implements SegmentIntersector
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.
- Version:
- 1.17
-
-
Constructor Summary
Constructors Constructor Description SnapRoundingIntersectionAdder(double nearnessTol)
Creates an intersector which finds all snapped interior intersections, and adds them as nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Coordinate>
getIntersections()
Gets the created intersection nodes, so they can be processed as hot pixels.boolean
isDone()
Always process all intersectionsvoid
processIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
This method is called by clients of theSegmentIntersector
class to process intersections for two segments of theSegmentString
s being intersected.
-
-
-
Method Detail
-
getIntersections
public java.util.List<Coordinate> getIntersections()
Gets the created intersection nodes, so they can be processed as hot pixels.- Returns:
- a list of the intersection points
-
processIntersections
public void processIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
This method is called by clients of theSegmentIntersector
class to process intersections for two segments of theSegmentString
s being intersected. Note that some clients (such asMonotoneChain
s) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).- Specified by:
processIntersections
in interfaceSegmentIntersector
-
isDone
public boolean isDone()
Always process all intersections- Specified by:
isDone
in interfaceSegmentIntersector
- Returns:
- false always
-
-