Package org.locationtech.jts.noding
Class IntersectionAdder
- java.lang.Object
-
- org.locationtech.jts.noding.IntersectionAdder
-
- All Implemented Interfaces:
SegmentIntersector
public class IntersectionAdder extends java.lang.Object implements SegmentIntersector
Computes the possible intersections between two line segments inNodedSegmentString
s and adds them to each string usingNodedSegmentString.addIntersection(LineIntersector, int, int, int)
.- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
hasInterior
private boolean
hasIntersection
These variables keep track of what types of intersections were found during ALL edges that have been intersected.private boolean
hasProper
private boolean
hasProperInterior
private boolean
isSelfIntersection
private LineIntersector
li
int
numInteriorIntersections
int
numIntersections
int
numProperIntersections
int
numTests
private Coordinate
properIntersectionPoint
-
Constructor Summary
Constructors Constructor Description IntersectionAdder(LineIntersector li)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LineIntersector
getLineIntersector()
Coordinate
getProperIntersectionPoint()
boolean
hasInteriorIntersection()
An interior intersection is an intersection which is in the interior of some segment.boolean
hasIntersection()
boolean
hasProperInteriorIntersection()
A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this SegmentIntersector.boolean
hasProperIntersection()
A proper intersection is an intersection which is interior to at least two line segments.static boolean
isAdjacentSegments(int i1, int i2)
boolean
isDone()
Always process all intersectionsprivate boolean
isTrivialIntersection(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
A trivial intersection is an apparent self-intersection which in fact is simply the point shared by adjacent line segments.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.
-
-
-
Field Detail
-
hasIntersection
private boolean hasIntersection
These variables keep track of what types of intersections were found during ALL edges that have been intersected.
-
hasProper
private boolean hasProper
-
hasProperInterior
private boolean hasProperInterior
-
hasInterior
private boolean hasInterior
-
properIntersectionPoint
private Coordinate properIntersectionPoint
-
li
private LineIntersector li
-
isSelfIntersection
private boolean isSelfIntersection
-
numIntersections
public int numIntersections
-
numInteriorIntersections
public int numInteriorIntersections
-
numProperIntersections
public int numProperIntersections
-
numTests
public int numTests
-
-
Constructor Detail
-
IntersectionAdder
public IntersectionAdder(LineIntersector li)
-
-
Method Detail
-
isAdjacentSegments
public static boolean isAdjacentSegments(int i1, int i2)
-
getLineIntersector
public LineIntersector getLineIntersector()
-
getProperIntersectionPoint
public Coordinate getProperIntersectionPoint()
- Returns:
- the proper intersection point, or
null
if none was found
-
hasIntersection
public boolean hasIntersection()
-
hasProperIntersection
public boolean hasProperIntersection()
A proper intersection is an intersection which is interior to at least two line segments. Note that a proper intersection is not necessarily in the interior of the entire Geometry, since another edge may have an endpoint equal to the intersection, which according to SFS semantics can result in the point being on the Boundary of the Geometry.
-
hasProperInteriorIntersection
public boolean hasProperInteriorIntersection()
A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this SegmentIntersector.
-
hasInteriorIntersection
public boolean hasInteriorIntersection()
An interior intersection is an intersection which is in the interior of some segment.
-
isTrivialIntersection
private boolean isTrivialIntersection(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
A trivial intersection is an apparent self-intersection which in fact is simply the point shared by adjacent line segments. Note that closed edges require a special check for the point shared by the beginning and end segments.
-
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
-
-