labelIsolatedNodes method

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.

Implementation

void labelIsolatedNodes() {
  for (Iterator ni = nodes.iterator(); ni.moveNext();) {
    Node n = ni.current;
    Label label = n.getLabel()!;
    // isolated nodes should always have at least one geometry in their label
    Assert.isTrue(
        label.getGeometryCount() > 0, "node with empty label found");
    if (n.isIsolated()) {
      if (label.isNull(0))
        labelIsolatedNode(n, 0);
      else
        labelIsolatedNode(n, 1);
    }
  }
}