Class 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 Detail

      • SnapRoundingIntersectionAdder

        public SnapRoundingIntersectionAdder​(double nearnessTol)
        Creates an intersector which finds all snapped interior intersections, and adds them as nodes.
        Parameters:
        nearnessTol - the intersection distance tolerance
    • 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 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).
        Specified by:
        processIntersections in interface SegmentIntersector
      • isDone

        public boolean isDone()
        Always process all intersections
        Specified by:
        isDone in interface SegmentIntersector
        Returns:
        false always