Package org.locationtech.jts.geomgraph
Class Edge
java.lang.Object
org.locationtech.jts.geomgraph.GraphComponent
org.locationtech.jts.geomgraph.Edge
- Version:
- 1.7
-
Field Summary
Fields inherited from class org.locationtech.jts.geomgraph.GraphComponent
label
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIntersection
(LineIntersector li, int segmentIndex, int geomIndex, int intIndex) Add an EdgeIntersection for intersection intIndex.void
addIntersections
(LineIntersector li, int segmentIndex, int geomIndex) Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list.void
Update the IM with the contribution for this component.boolean
equals is defined to be:getCoordinate
(int i) getDepth()
int
The depthDelta is the change in depth as an edge is crossed from R to Lint
int
int
hashCode()
boolean
isClosed()
boolean
An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposite (eg a zero-width V).boolean
An isolated component is one that does not intersect or touch any other component.boolean
Check if coordinate sequences of the Edges are identical.void
print
(PrintStream out) void
printReverse
(PrintStream out) void
setDepthDelta
(int depthDelta) void
setIsolated
(boolean isIsolated) void
toString()
static void
updateIM
(Label label, IntersectionMatrix im) Updates an IM from the label for an edge.Methods inherited from class org.locationtech.jts.geomgraph.GraphComponent
getLabel, isCovered, isCoveredSet, isInResult, isVisited, setCovered, setInResult, setLabel, setVisited, updateIM
-
Constructor Details
-
Edge
-
Edge
-
-
Method Details
-
updateIM
Updates an IM from the label for an edge. Handles edges from both L and A geometries.- Parameters:
label
- Label defining positionim
- intersection matrix
-
getNumPoints
public int getNumPoints() -
setName
-
getCoordinates
-
getCoordinate
-
getCoordinate
- Specified by:
getCoordinate
in classGraphComponent
- Returns:
- a coordinate in this component (or null, if there are none)
-
getEnvelope
-
getDepth
-
getDepthDelta
public int getDepthDelta()The depthDelta is the change in depth as an edge is crossed from R to L- Returns:
- the change in depth as the edge is crossed from R to L
-
setDepthDelta
public void setDepthDelta(int depthDelta) -
getMaximumSegmentIndex
public int getMaximumSegmentIndex() -
getEdgeIntersectionList
-
getMonotoneChainEdge
-
isClosed
public boolean isClosed() -
isCollapsed
public boolean isCollapsed()An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposite (eg a zero-width V).- Returns:
- zero-width V area edge, consisting of two segments which are equal and of oppose orientation
-
getCollapsedEdge
-
setIsolated
public void setIsolated(boolean isIsolated) -
isIsolated
public boolean isIsolated()Description copied from class:GraphComponent
An isolated component is one that does not intersect or touch any other component. This is the case if the label has valid locations for only a single Geometry.- Specified by:
isIsolated
in classGraphComponent
- Returns:
- true if this component is isolated
-
addIntersections
Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list.- Parameters:
li
- Determining number of intersections to addsegmentIndex
- Segment index to addgeomIndex
- Geometry index to add
-
addIntersection
Add an EdgeIntersection for intersection intIndex. An intersection that falls exactly on a vertex of the edge is normalized to use the higher of the two possible segmentIndexes- Parameters:
li
- Determining number of intersections to addsegmentIndex
- Segment index to addgeomIndex
- Geometry index to addintIndex
- intIndex is 0 or 1
-
computeIM
Update the IM with the contribution for this component. A component only contributes if it has a labelling for both parent geometries- Specified by:
computeIM
in classGraphComponent
- Parameters:
im
- Intersection matrix
-
equals
equals is defined to be:e1 equals e2 iff the coordinates of e1 are the same or the reverse of the coordinates in e2
-
hashCode
public int hashCode() -
isPointwiseEqual
Check if coordinate sequences of the Edges are identical.- Parameters:
e
- Edge- Returns:
- true if the coordinate sequences of the Edges are identical
-
toString
-
print
-
printReverse
-