Class DirectedEdge

java.lang.Object
org.locationtech.jts.geomgraph.EdgeEnd
org.locationtech.jts.geomgraph.DirectedEdge
All Implemented Interfaces:
Comparable

public class DirectedEdge extends EdgeEnd
Version:
1.7
  • Field Details

    • isForward

      protected boolean isForward
  • Constructor Details

    • DirectedEdge

      public DirectedEdge(Edge edge, boolean isForward)
  • Method Details

    • depthFactor

      public static int depthFactor(int currLocation, int nextLocation)
      Computes the factor for the change in depth when moving from one location to another. E.g. if crossing from the Location.INTERIOR to theLocation.EXTERIOR the depth decreases, so the factor is -1.
      Parameters:
      currLocation - Current location
      nextLocation - Next location
      Returns:
      change of depth moving from currLocation to nextLocation
    • getEdge

      public Edge getEdge()
      Overrides:
      getEdge in class EdgeEnd
    • setInResult

      public void setInResult(boolean isInResult)
    • isInResult

      public boolean isInResult()
    • isVisited

      public boolean isVisited()
    • setVisited

      public void setVisited(boolean isVisited)
    • setEdgeRing

      public void setEdgeRing(EdgeRing edgeRing)
    • getEdgeRing

      public EdgeRing getEdgeRing()
    • setMinEdgeRing

      public void setMinEdgeRing(EdgeRing minEdgeRing)
    • getMinEdgeRing

      public EdgeRing getMinEdgeRing()
    • getDepth

      public int getDepth(int position)
    • setDepth

      public void setDepth(int position, int depthVal)
      Set depth for a position. You may also use setEdgeDepths(int, int) to update depth and opposite depth together.
      Parameters:
      position - Position to update
      depthVal - Depth at the provided position
    • getDepthDelta

      public int getDepthDelta()
    • setVisitedEdge

      public void setVisitedEdge(boolean isVisited)
      Marks both DirectedEdges attached to a given Edge. This is used for edges corresponding to lines, which will only appear oriented in a single direction in the result.
      Parameters:
      isVisited - True to mark edge as visited
    • getSym

      public DirectedEdge getSym()
      Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
      Returns:
      the DirectedEdge for the same Edge but in the opposite direction
    • isForward

      public boolean isForward()
    • setSym

      public void setSym(DirectedEdge de)
    • getNext

      public DirectedEdge getNext()
    • setNext

      public void setNext(DirectedEdge next)
    • getNextMin

      public DirectedEdge getNextMin()
    • setNextMin

      public void setNextMin(DirectedEdge nextMin)
    • isLineEdge

      public boolean isLineEdge()
      This edge is a line edge if
      • at least one of the labels is a line label
      • any labels which are not line labels have all Locations = EXTERIOR
      Returns:
      If edge is a line edge
    • isInteriorAreaEdge

      public boolean isInteriorAreaEdge()
      This is an interior Area edge if
      • its label is an Area label for both Geometries
      • and for each Geometry both sides are in the interior.
      Returns:
      true if this is an interior Area edge
    • setEdgeDepths

      public void setEdgeDepths(int position, int depth)
      Set both edge depths. One depth for a given side is provided. The other is computed depending on the Location transition and the depthDelta of the edge.
      Parameters:
      position - Position to update
      depth - Depth at the provided position
    • print

      public void print(PrintStream out)
      Overrides:
      print in class EdgeEnd
    • printEdge

      public void printEdge(PrintStream out)