public class GeometryGraph extends PlanarGraph
Modifier and Type | Field and Description |
---|---|
private PointOnGeometryLocator |
areaPtLocator |
private int |
argIndex |
private BoundaryNodeRule |
boundaryNodeRule |
private java.util.Collection |
boundaryNodes |
private boolean |
hasTooFewPoints |
private Coordinate |
invalidPoint |
private java.util.Map |
lineEdgeMap
The lineEdgeMap is a map of the linestring components of the
parentGeometry to the edges which are derived from them.
|
private Geometry |
parentGeom |
private PointLocator |
ptLocator |
private boolean |
useBoundaryDeterminationRule
If this flag is true, the Boundary Determination Rule will used when deciding
whether nodes are in the boundary or not
|
edgeEndList, edges, nodes
Constructor and Description |
---|
GeometryGraph(int argIndex,
Geometry parentGeom) |
GeometryGraph(int argIndex,
Geometry parentGeom,
BoundaryNodeRule boundaryNodeRule) |
Modifier and Type | Method and Description |
---|---|
private void |
add(Geometry g) |
private void |
addCollection(GeometryCollection gc) |
void |
addEdge(Edge e)
Add an Edge computed externally.
|
private void |
addLineString(LineString line) |
void |
addPoint(Coordinate pt)
Add a point computed externally.
|
private void |
addPoint(Point p)
Add a Point to the graph.
|
private void |
addPolygon(Polygon p) |
private void |
addPolygonRing(LinearRing lr,
int cwLeft,
int cwRight)
Adds a polygon ring to the graph.
|
private void |
addSelfIntersectionNode(int argIndex,
Coordinate coord,
int loc)
Add a node for a self-intersection.
|
private void |
addSelfIntersectionNodes(int argIndex) |
SegmentIntersector |
computeEdgeIntersections(GeometryGraph g,
LineIntersector li,
boolean includeProper) |
SegmentIntersector |
computeSelfNodes(LineIntersector li,
boolean computeRingSelfNodes)
Compute self-nodes, taking advantage of the Geometry type to
minimize the number of intersection tests.
|
SegmentIntersector |
computeSelfNodes(LineIntersector li,
boolean computeRingSelfNodes,
boolean isDoneIfProperInt)
Compute self-nodes, taking advantage of the Geometry type to
minimize the number of intersection tests.
|
void |
computeSplitEdges(java.util.List edgelist) |
private EdgeSetIntersector |
createEdgeSetIntersector() |
static int |
determineBoundary(BoundaryNodeRule boundaryNodeRule,
int boundaryCount)
This method implements the Boundary Determination Rule
for determining whether
a component (node or edge) that appears multiple times in elements
of a MultiGeometry is in the boundary or the interior of the Geometry
The SFS uses the "Mod-2 Rule", which this function implements An alternative (and possibly more intuitive) rule would be the "At Most One Rule": isInBoundary = (componentCount == 1) |
Edge |
findEdge(LineString line) |
BoundaryNodeRule |
getBoundaryNodeRule() |
java.util.Collection |
getBoundaryNodes() |
Coordinate[] |
getBoundaryPoints() |
Geometry |
getGeometry() |
Coordinate |
getInvalidPoint() |
boolean |
hasTooFewPoints()
This constructor is used by clients that wish to add Edges explicitly,
rather than adding a Geometry.
|
private void |
insertBoundaryPoint(int argIndex,
Coordinate coord)
Adds candidate boundary points using the current
BoundaryNodeRule . |
private void |
insertPoint(int argIndex,
Coordinate coord,
int onLocation) |
int |
locate(Coordinate pt)
Determines the
Location of the given Coordinate
in this geometry. |
add, addEdges, addNode, addNode, debugPrint, debugPrintln, find, findEdge, findEdgeEnd, findEdgeInSameDirection, getEdgeEnds, getEdgeIterator, getNodeIterator, getNodes, insertEdge, isBoundaryNode, linkAllDirectedEdges, linkResultDirectedEdges, linkResultDirectedEdges, printEdges
private Geometry parentGeom
private java.util.Map lineEdgeMap
private BoundaryNodeRule boundaryNodeRule
private boolean useBoundaryDeterminationRule
private int argIndex
private java.util.Collection boundaryNodes
private boolean hasTooFewPoints
private Coordinate invalidPoint
private PointOnGeometryLocator areaPtLocator
private final PointLocator ptLocator
public GeometryGraph(int argIndex, Geometry parentGeom)
public GeometryGraph(int argIndex, Geometry parentGeom, BoundaryNodeRule boundaryNodeRule)
public static int determineBoundary(BoundaryNodeRule boundaryNodeRule, int boundaryCount)
private EdgeSetIntersector createEdgeSetIntersector()
public boolean hasTooFewPoints()
public Coordinate getInvalidPoint()
public Geometry getGeometry()
public BoundaryNodeRule getBoundaryNodeRule()
public java.util.Collection getBoundaryNodes()
public Coordinate[] getBoundaryPoints()
public Edge findEdge(LineString line)
public void computeSplitEdges(java.util.List edgelist)
private void add(Geometry g)
private void addCollection(GeometryCollection gc)
private void addPoint(Point p)
private void addPolygonRing(LinearRing lr, int cwLeft, int cwRight)
private void addPolygon(Polygon p)
private void addLineString(LineString line)
public void addEdge(Edge e)
public void addPoint(Coordinate pt)
public SegmentIntersector computeSelfNodes(LineIntersector li, boolean computeRingSelfNodes)
li
- the LineIntersector to usecomputeRingSelfNodes
- if false
, intersection checks are optimized to not test rings for self-intersectionpublic SegmentIntersector computeSelfNodes(LineIntersector li, boolean computeRingSelfNodes, boolean isDoneIfProperInt)
li
- the LineIntersector to usecomputeRingSelfNodes
- if false
, intersection checks are optimized to not test rings for self-intersectionisDoneIfProperInt
- short-circuit the intersection computation if a proper intersection is foundpublic SegmentIntersector computeEdgeIntersections(GeometryGraph g, LineIntersector li, boolean includeProper)
private void insertPoint(int argIndex, Coordinate coord, int onLocation)
private void insertBoundaryPoint(int argIndex, Coordinate coord)
BoundaryNodeRule
.
This is used to add the boundary
points of dim-1 geometries (Curves/MultiCurves).private void addSelfIntersectionNodes(int argIndex)
private void addSelfIntersectionNode(int argIndex, Coordinate coord, int loc)
public int locate(Coordinate pt)
Location
of the given Coordinate
in this geometry.pt
- the point to test