Package org.locationtech.jts.geomgraph
Class EdgeEnd
java.lang.Object
org.locationtech.jts.geomgraph.EdgeEnd
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
DirectedEdge
,EdgeEndBundle
Models the end of an edge incident on a node.
EdgeEnds have a direction
determined by the direction of the ray from the initial
point to the next point.
EdgeEnds are comparable under the ordering
"a has a greater angle with the x-axis than b".
This ordering is used to sort EdgeEnds around a node.
- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EdgeEnd
(Edge edge, Coordinate p0, Coordinate p1) EdgeEnd
(Edge edge, Coordinate p0, Coordinate p1, Label label) -
Method Summary
Modifier and TypeMethodDescriptionint
Implements the total order relation:int
void
computeLabel
(BoundaryNodeRule boundaryNodeRule) double
getDx()
double
getDy()
getEdge()
getLabel()
getNode()
int
protected void
init
(Coordinate p0, Coordinate p1) void
print
(PrintStream out) void
toString()
-
Field Details
-
edge
-
label
-
-
Constructor Details
-
EdgeEnd
-
EdgeEnd
-
EdgeEnd
-
-
Method Details
-
init
-
getEdge
-
getLabel
-
getCoordinate
-
getDirectedCoordinate
-
getQuadrant
public int getQuadrant() -
getDx
public double getDx() -
getDy
public double getDy() -
setNode
-
getNode
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
compareDirection
Implements the total order relation:a has a greater angle with the positive x-axis than b
Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is obviously susceptible to roundoff. A robust algorithm is: - first compare the quadrant. If the quadrants are different, it it trivial to determine which vector is "greater". - if the vectors lie in the same quadrant, the computeOrientation function can be used to decide the relative orientation of the vectors.
- Parameters:
e
- EdgeEnd- Returns:
- direction comparison
-
computeLabel
-
print
-
toString
-