copyNodesAndLabels method

void copyNodesAndLabels(
  1. GeometryGraph geomGraph,
  2. 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)

Implementation

void copyNodesAndLabels(GeometryGraph geomGraph, int argIndex) {
  for (Iterator nodeIt = geomGraph.getNodeIterator(); nodeIt.moveNext();) {
    Node graphNode = nodeIt.current as Node;
    Node newNode = nodes.addNodeFromCoordinate(graphNode.getCoordinate());
    newNode.setLabelWithIndex(
        argIndex, graphNode.getLabel()!.getLocation(argIndex));
//node.print(System.out);
  }
}