com.vividsolutions.jts.geomgraph

Class EdgeRing

Known Direct Subclasses:
MaximalEdgeRing, MinimalEdgeRing

public abstract class EdgeRing
extends java.lang.Object

Version:
1.6

Field Summary

protected CGAlgorithms
cga
protected GeometryFactory
geometryFactory
protected DirectedEdge
startDe

Constructor Summary

EdgeRing(DirectedEdge start, GeometryFactory geometryFactory, CGAlgorithms cga)

Method Summary

void
addHole(EdgeRing ring)
protected void
addPoints(Edge edge, boolean isForward, boolean isFirstEdge)
protected void
computePoints(DirectedEdge start)
Collect all the points from the DirectedEdges of this ring into a contiguous list
void
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)
List
getEdges()
Returns the list of DirectedEdges that make up this EdgeRing
Label
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 Details

cga

protected CGAlgorithms cga

geometryFactory

protected GeometryFactory geometryFactory

startDe

protected DirectedEdge startDe

Constructor Details

EdgeRing

public EdgeRing(DirectedEdge start,
                GeometryFactory geometryFactory,
                CGAlgorithms cga)

Method Details

addHole

public void addHole(EdgeRing ring)

addPoints

protected void addPoints(Edge edge,
                         boolean isForward,
                         boolean isFirstEdge)

computePoints

protected void computePoints(DirectedEdge start)
Collect all the points from the DirectedEdges of this ring into a contiguous list

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.

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.

getCoordinate

public Coordinate getCoordinate(int i)

getEdges

public List getEdges()
Returns the list of DirectedEdges that make up this EdgeRing

getLabel

public Label getLabel()

getLinearRing

public LinearRing getLinearRing()

getMaxNodeDegree

public int getMaxNodeDegree()

getNext

public abstract DirectedEdge getNext(DirectedEdge de)

getShell

public EdgeRing getShell()

isHole

public boolean isHole()

isIsolated

public boolean isIsolated()

isShell

public boolean isShell()

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.

setEdgeRing

public abstract void setEdgeRing(DirectedEdge de,
                                 EdgeRing er)

setInResult

public void setInResult()

setShell

public void setShell(EdgeRing shell)

toPolygon

public Polygon toPolygon(GeometryFactory geometryFactory)