Package org.geotools.geometry.iso.topograph2D

Examples of org.geotools.geometry.iso.topograph2D.Node


   * computed label of BOUNDARY, but in the original arg Geometry it is
   * actually in the interior due to the Boundary Determination Rule)
   */
  private void copyPoints(int argIndex) {
    for (Iterator i = arg[argIndex].getNodeIterator(); i.hasNext();) {
      Node graphNode = (Node) i.next();
      Node newNode = graph.addNode(graphNode.getCoordinate());
      newNode.setLabel(argIndex, graphNode.getLabel().getLocation(
          argIndex));
    }
  }
View Full Code Here


   * labels for both Geometries) only if they are incident on a node which has
   * edges for both Geometries
   */
  private void computeLabelling() {
    for (Iterator nodeit = graph.getNodes().iterator(); nodeit.hasNext();) {
      Node node = (Node) nodeit.next();
      // if (node.getCoordinate().equals(new Coordinate(222, 100)) )
      // Debug.addWatch(node.getEdges());
      node.getEdges().computeLabelling(arg);
    }
    mergeSymLabels();
    updateNodeLabelling();
  }
View Full Code Here

   * other Geometry. However, the sym dirEdge may have a labelling for the
   * other Geometry, so merge the two labels.
   */
  private void mergeSymLabels() {
    for (Iterator nodeit = graph.getNodes().iterator(); nodeit.hasNext();) {
      Node node = (Node) nodeit.next();
      ((DirectedEdgeStar) node.getEdges()).mergeSymLabels();
      // node.print(System.out);
    }
  }
View Full Code Here

    // update the labels for nodes
    // The label for a node is updated from the edges incident on it
    // (Note that a node may have already been labelled
    // because it is a point in one of the input geometries)
    for (Iterator nodeit = graph.getNodes().iterator(); nodeit.hasNext();) {
      Node node = (Node) nodeit.next();
      Label lbl = ((DirectedEdgeStar) node.getEdges()).getLabel();
      node.getLabel().merge(lbl);
    }
  }
View Full Code Here

   * When each node labelling is completed, the labelling of the incident
   * edges is updated, to complete their labelling as well.
   */
  private void labelIncompleteNodes() {
    for (Iterator ni = graph.getNodes().iterator(); ni.hasNext();) {
      Node n = (Node) ni.next();
      Label label = n.getLabel();
      if (n.isIsolated()) {
        if (label.isNull(0))
          labelIncompleteNode(n, 0);
        else
          labelIncompleteNode(n, 1);
      }
      // now update the labelling for the DirectedEdges incident on this
      // node
      ((DirectedEdgeStar) n.getEdges()).updateLabelling(label);
      // n.print(System.out);
    }
  }
View Full Code Here

* @source $URL$
* @version 1.7.2
*/
public class OverlayNodeFactory extends NodeFactory {
  public Node createNode(Coordinate coord) {
    return new Node(coord, new DirectedEdgeStar());
  }
View Full Code Here

   */
  private void findCoveredLineEdges() {
    // first set covered for all L edges at nodes which have A edges too
    for (Iterator nodeit = op.getGraph().getNodes().iterator(); nodeit
        .hasNext();) {
      Node node = (Node) nodeit.next();
      // node.print(System.out);
      ((DirectedEdgeStar) node.getEdges()).findCoveredLineEdges();
    }

    /**
     * For all L edges which weren't handled by the above, use a
     * point-in-poly test to determine whether they are covered
View Full Code Here

    // testing only
    // if (true) return resultNodeList;

    for (Iterator nodeit = op.getGraph().getNodes().iterator(); nodeit
        .hasNext();) {
      Node n = (Node) nodeit.next();

      // filter out nodes which are known to be in the result
      if (n.isInResult())
        continue;
      // if an incident edge is in the result, then the node coordinate is
      // included already
      if (n.isIncidentEdgeInResult())
        continue;
      if (n.getEdges().getDegree() == 0
          || opCode == OverlayOp.INTERSECTION) {

        /**
         * For nodes on edges, only INTERSECTION can result in edge
         * nodes being included even if none of their incident edges are
         * included
         */
        Label label = n.getLabel();
        if (OverlayOp.isResultOfOp(label, opCode)) {
          filterCoveredNodeToPoint(n);
        }
      }
    }
View Full Code Here

   * form minimalEdgeRings
   */
  public void linkDirectedEdgesForMinimalEdgeRings() {
    DirectedEdge de = startDe;
    do {
      Node node = de.getNode();
      ((DirectedEdgeStar) node.getEdges()).linkMinimalDirectedEdges(this);
      de = de.getNext();
    } while (de != startDe);
  }
View Full Code Here

    return false;
  }

  private boolean isBoundaryPoint(LineIntersector li, Collection bdyNodes) {
    for (Iterator i = bdyNodes.iterator(); i.hasNext();) {
      Node node = (Node) i.next();
      Coordinate pt = node.getCoordinate();
      if (li.isIntersection(pt))
        return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.iso.topograph2D.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.