public class SnapRoundingIntersectionAdder extends Object implements SegmentIntersector
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.
Constructor and Description |
---|
SnapRoundingIntersectionAdder(double nearnessTol)
Creates an intersector which finds all snapped interior intersections,
and adds them as nodes.
|
Modifier and Type | Method and Description |
---|---|
List<Coordinate> |
getIntersections()
Gets the created intersection nodes,
so they can be processed as hot pixels.
|
boolean |
isDone()
Always process all intersections
|
void |
processIntersections(SegmentString e0,
int segIndex0,
SegmentString e1,
int segIndex1)
This method is called by clients
of the
SegmentIntersector class to process
intersections for two segments of the SegmentString s being intersected. |
public SnapRoundingIntersectionAdder(double nearnessTol)
nearnessTol
- the intersection distance tolerancepublic List<Coordinate> getIntersections()
public void processIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
SegmentIntersector
class to process
intersections for two segments of the SegmentString
s being intersected.
Note that some clients (such as MonotoneChain
s) may optimize away
this call for segment pairs which they have determined do not intersect
(e.g. by an disjoint envelope test).processIntersections
in interface SegmentIntersector
public boolean isDone()
isDone
in interface SegmentIntersector
Copyright © 2022. All rights reserved.