Package org.locationtech.jts.geomgraph
Class GeometryGraph
- java.lang.Object
-
- org.locationtech.jts.geomgraph.PlanarGraph
-
- org.locationtech.jts.geomgraph.GeometryGraph
-
public class GeometryGraph extends PlanarGraph
A GeometryGraph is a graph that models a given Geometry- Version:
- 1.7
-
-
Field Summary
-
Fields inherited from class org.locationtech.jts.geomgraph.PlanarGraph
edgeEndList, edges, nodes
-
-
Constructor Summary
Constructors Constructor Description GeometryGraph(int argIndex, Geometry parentGeom)GeometryGraph(int argIndex, Geometry parentGeom, BoundaryNodeRule boundaryNodeRule)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(Edge e)Add an Edge computed externally.voidaddPoint(Coordinate pt)Add a point computed externally.SegmentIntersectorcomputeEdgeIntersections(GeometryGraph g, LineIntersector li, boolean includeProper)SegmentIntersectorcomputeSelfNodes(LineIntersector li, boolean computeRingSelfNodes)Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests.voidcomputeSplitEdges(List edgelist)static intdetermineBoundary(BoundaryNodeRule boundaryNodeRule, int boundaryCount)Determine boundaryEdgefindEdge(LineString line)BoundaryNodeRulegetBoundaryNodeRule()CollectiongetBoundaryNodes()Coordinate[]getBoundaryPoints()GeometrygetGeometry()CoordinategetInvalidPoint()booleanhasTooFewPoints()intlocate(Coordinate pt)Determines theLocationof the givenCoordinatein this geometry.-
Methods inherited from class org.locationtech.jts.geomgraph.PlanarGraph
add, addEdges, addNode, addNode, find, findEdge, findEdgeEnd, findEdgeInSameDirection, getEdgeEnds, getEdgeIterator, getNodeIterator, getNodes, insertEdge, isBoundaryNode, linkAllDirectedEdges, linkResultDirectedEdges, linkResultDirectedEdges, printEdges
-
-
-
-
Constructor Detail
-
GeometryGraph
public GeometryGraph(int argIndex, Geometry parentGeom)
-
GeometryGraph
public GeometryGraph(int argIndex, Geometry parentGeom, BoundaryNodeRule boundaryNodeRule)
-
-
Method Detail
-
determineBoundary
public static int determineBoundary(BoundaryNodeRule boundaryNodeRule, int boundaryCount)
Determine boundary- Parameters:
boundaryNodeRule- Boundary node ruleboundaryCount- the number of component boundaries that this point occurs in- Returns:
- boundary or interior
-
hasTooFewPoints
public boolean hasTooFewPoints()
-
getInvalidPoint
public Coordinate getInvalidPoint()
-
getGeometry
public Geometry getGeometry()
-
getBoundaryNodeRule
public BoundaryNodeRule getBoundaryNodeRule()
-
getBoundaryNodes
public Collection getBoundaryNodes()
-
getBoundaryPoints
public Coordinate[] getBoundaryPoints()
-
findEdge
public Edge findEdge(LineString line)
-
computeSplitEdges
public void computeSplitEdges(List edgelist)
-
addEdge
public void addEdge(Edge e)
Add an Edge computed externally. The label on the Edge is assumed to be correct.- Parameters:
e- Edge
-
addPoint
public void addPoint(Coordinate pt)
Add a point computed externally. The point is assumed to be a Point Geometry part, which has a location of INTERIOR.- Parameters:
pt- Coordinate
-
computeSelfNodes
public SegmentIntersector computeSelfNodes(LineIntersector li, boolean computeRingSelfNodes)
Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests. (E.g. rings are not tested for self-intersection, since they are assumed to be valid).- Parameters:
li- the LineIntersector to usecomputeRingSelfNodes- iffalse, intersection checks are optimized to not test rings for self-intersection- Returns:
- the computed SegmentIntersector containing information about the intersections found
-
computeEdgeIntersections
public SegmentIntersector computeEdgeIntersections(GeometryGraph g, LineIntersector li, boolean includeProper)
-
locate
public int locate(Coordinate pt)
Determines theLocationof the givenCoordinatein this geometry.- Parameters:
pt- the point to test- Returns:
- the location of the point in the geometry
-
-