Package org.locationtech.jts.geomgraph
Class EdgeRing
- java.lang.Object
-
- org.locationtech.jts.geomgraph.EdgeRing
-
- Direct Known Subclasses:
MaximalEdgeRing
,MinimalEdgeRing
public abstract class EdgeRing extends java.lang.Object
- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
edges
protected GeometryFactory
geometryFactory
private java.util.ArrayList
holes
private boolean
isHole
private Label
label
private int
maxNodeDegree
private java.util.List
pts
private LinearRing
ring
private EdgeRing
shell
protected DirectedEdge
startDe
-
Constructor Summary
Constructors Constructor Description EdgeRing(DirectedEdge start, GeometryFactory geometryFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addHole(EdgeRing ring)
protected void
addPoints(Edge edge, boolean isForward, boolean isFirstEdge)
private void
computeMaxNodeDegree()
protected void
computePoints(DirectedEdge start)
Collect all the points from the DirectedEdges of this ring into a contiguous listvoid
computeRing()
Compute a LinearRing from the point list previously collected.boolean
containsPoint(Coordinate p)
This method will cause the ring to be computed.Coordinate
getCoordinate(int i)
java.util.List
getEdges()
Returns the list of DirectedEdges that make up this EdgeRingLabel
getLabel()
LinearRing
getLinearRing()
int
getMaxNodeDegree()
abstract DirectedEdge
getNext(DirectedEdge de)
EdgeRing
getShell()
boolean
isHole()
boolean
isIsolated()
boolean
isShell()
protected void
mergeLabel(Label deLabel)
protected void
mergeLabel(Label deLabel, int geomIndex)
Merge the RHS label from a DirectedEdge into the label for this EdgeRing.abstract void
setEdgeRing(DirectedEdge de, EdgeRing er)
void
setInResult()
void
setShell(EdgeRing shell)
Polygon
toPolygon(GeometryFactory geometryFactory)
-
-
-
Field Detail
-
startDe
protected DirectedEdge startDe
-
maxNodeDegree
private int maxNodeDegree
-
edges
private java.util.List edges
-
pts
private java.util.List pts
-
label
private Label label
-
ring
private LinearRing ring
-
isHole
private boolean isHole
-
shell
private EdgeRing shell
-
holes
private java.util.ArrayList holes
-
geometryFactory
protected GeometryFactory geometryFactory
-
-
Constructor Detail
-
EdgeRing
public EdgeRing(DirectedEdge start, GeometryFactory geometryFactory)
-
-
Method Detail
-
isIsolated
public boolean isIsolated()
-
isHole
public boolean isHole()
-
getCoordinate
public Coordinate getCoordinate(int i)
-
getLinearRing
public LinearRing getLinearRing()
-
getLabel
public Label getLabel()
-
isShell
public boolean isShell()
-
getShell
public EdgeRing getShell()
-
setShell
public void setShell(EdgeRing shell)
-
addHole
public void addHole(EdgeRing ring)
-
toPolygon
public Polygon toPolygon(GeometryFactory geometryFactory)
-
computeRing
public void computeRing()
Compute a LinearRing from the point list previously collected. Test if the ring is a hole (i.e. if it is CCW) and set the hole flag accordingly.
-
getNext
public abstract DirectedEdge getNext(DirectedEdge de)
-
setEdgeRing
public abstract void setEdgeRing(DirectedEdge de, EdgeRing er)
-
getEdges
public java.util.List getEdges()
Returns the list of DirectedEdges that make up this EdgeRing
-
computePoints
protected void computePoints(DirectedEdge start)
Collect all the points from the DirectedEdges of this ring into a contiguous list
-
getMaxNodeDegree
public int getMaxNodeDegree()
-
computeMaxNodeDegree
private void computeMaxNodeDegree()
-
setInResult
public void setInResult()
-
mergeLabel
protected void mergeLabel(Label deLabel)
-
mergeLabel
protected void mergeLabel(Label deLabel, int geomIndex)
Merge the RHS label from a DirectedEdge into the label for this EdgeRing. The DirectedEdge label may be null. This is acceptable - it results from a node which is NOT an intersection node between the Geometries (e.g. the end node of a LinearRing). In this case the DirectedEdge label does not contribute any information to the overall labelling, and is simply skipped.
-
addPoints
protected void addPoints(Edge edge, boolean isForward, boolean isFirstEdge)
-
containsPoint
public boolean containsPoint(Coordinate p)
This method will cause the ring to be computed. It will also check any holes, if they have been assigned.
-
-