Class RelateComputer
java.lang.Object
org.locationtech.jts.operation.relate.RelateComputer
Computes the topological relationship between two Geometries.
RelateComputer does not need to build a complete graph structure to compute the IntersectionMatrix. The relationship between the geometries can be computed by simply examining the labelling of edges incident on each node.
RelateComputer does not currently support arbitrary GeometryCollections. This is because GeometryCollections can contain overlapping Polygons. In order to correct compute relate on overlapping Polygons, they would first need to be noded and merged (if not explicitly, at least implicitly).
- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GeometryGraph[]
private IntersectionMatrix
private Coordinate
private ArrayList
private LineIntersector
private NodeMap
private PointLocator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
If the Geometries are disjoint, we need to enter their dimension and boundary dimension in the Ext rows in the IMprivate void
computeIntersectionNodes
(int argIndex) Insert nodes for all intersections on the edges of a Geometry.private void
computeProperIntersectionIM
(SegmentIntersector intersector, IntersectionMatrix im) private void
copyNodesAndLabels
(int argIndex) Copy all nodes from an arg geometry into this graph.private void
insertEdgeEnds
(List ee) private void
labelIntersectionNodes
(int argIndex) For all intersections on the edges of a Geometry, label the corresponding node IF it doesn't already have a label.private void
labelIsolatedEdge
(Edge e, int targetIndex, Geometry target) Label an isolated edge of a graph with its relationship to the target geometry.private void
labelIsolatedEdges
(int thisIndex, int targetIndex) Processes isolated edges by computing their labelling and adding them to the isolated edges list.private void
labelIsolatedNode
(Node n, int targetIndex) Label an isolated node with its relationship to the target geometry.private void
Isolated nodes are nodes whose labels are incomplete (e.g.private void
private void
update the IM with the sum of the IMs for each component
-
Field Details
-
li
-
ptLocator
-
arg
-
nodes
-
im
-
isolatedEdges
-
invalidPoint
-
-
Constructor Details
-
RelateComputer
-
-
Method Details
-
computeIM
-
insertEdgeEnds
-
computeProperIntersectionIM
-
copyNodesAndLabels
private void copyNodesAndLabels(int argIndex) Copy all nodes from an arg geometry into this graph. The node label in the arg geometry overrides any previously computed label for that argIndex. (E.g. a node may be an intersection node with a computed label of BOUNDARY, but in the original arg Geometry it is actually in the interior due to the Boundary Determination Rule) -
computeIntersectionNodes
private void computeIntersectionNodes(int argIndex) Insert nodes for all intersections on the edges of a Geometry. Label the created nodes the same as the edge label if they do not already have a label. This allows nodes created by either self-intersections or mutual intersections to be labelled. Endpoint nodes will already be labelled from when they were inserted. -
labelIntersectionNodes
private void labelIntersectionNodes(int argIndex) For all intersections on the edges of a Geometry, label the corresponding node IF it doesn't already have a label. This allows nodes created by either self-intersections or mutual intersections to be labelled. Endpoint nodes will already be labelled from when they were inserted. -
computeDisjointIM
If the Geometries are disjoint, we need to enter their dimension and boundary dimension in the Ext rows in the IM -
labelNodeEdges
private void labelNodeEdges() -
updateIM
update the IM with the sum of the IMs for each component -
labelIsolatedEdges
private void labelIsolatedEdges(int thisIndex, int targetIndex) Processes isolated edges by computing their labelling and adding them to the isolated edges list. Isolated edges are guaranteed not to touch the boundary of the target (since if they did, they would have caused an intersection to be computed and hence would not be isolated) -
labelIsolatedEdge
Label an isolated edge of a graph with its relationship to the target geometry. If the target has dim 2 or 1, the edge can either be in the interior or the exterior. If the target has dim 0, the edge must be in the exterior -
labelIsolatedNodes
private void labelIsolatedNodes()Isolated nodes are nodes whose labels are incomplete (e.g. the location for one Geometry is null). This is the case because nodes in one graph which don't intersect nodes in the other are not completely labelled by the initial process of adding nodes to the nodeList. To complete the labelling we need to check for nodes that lie in the interior of edges, and in the interior of areas. -
labelIsolatedNode
Label an isolated node with its relationship to the target geometry.
-