Package org.geotools.geometry.iso.topograph2D

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


    // fast lookup
    Edge existingEdge = edgeList.findEqualEdge(e);

    // If an identical edge already exists, simply update its label
    if (existingEdge != null) {
      Label existingLabel = existingEdge.getLabel();

      Label labelToMerge = e.getLabel();
      // check if new edge is in reverse direction to existing edge
      // if so, must flip the label before merging it
      if (!existingEdge.isPointwiseEqual(e)) {
        labelToMerge = new Label(e.getLabel());
        labelToMerge.flip();
      }
      Depth depth = existingEdge.getDepth();
      // if this is the first duplicate found for this edge, initialize
      // the depths
      // /*
 
View Full Code Here


   * corresponds to INTERIOR)
   */
  private void computeLabelsFromDepths() {
    for (Iterator it = edgeList.iterator(); it.hasNext();) {
      Edge e = (Edge) it.next();
      Label lbl = e.getLabel();
      Depth depth = e.getDepth();
      /**
       * Only check edges for which there were duplicates, since these are
       * the only ones which might be the result of dimensional collapses.
       */
      if (!depth.isNull()) {
        depth.normalize();
        for (int i = 0; i < 2; i++) {
          if (!lbl.isNull(i) && lbl.isArea() && !depth.isNull(i)) {
            /**
             * if the depths are equal, this edge is the result of
             * the dimensional collapse of two or more edges. It has
             * the same location on both sides of the edge, so it
             * has collapsed to a line.
             */
            if (depth.getDelta(i) == 0) {
              lbl.toLine(i);
            } else {
              /**
               * This edge may be the result of a dimensional
               * collapse, but it still has different locations on
               * both sides. The label of the edge must be updated
               * to reflect the resultant side locations indicated
               * by the depth values.
               */
              Assert
                  .isTrue(!depth.isNull(i, Position.LEFT),
                      "depth of LEFT side has not been initialized");
              lbl.setLocation(i, Position.LEFT, depth
                  .getLocation(i, Position.LEFT));
              Assert
                  .isTrue(!depth.isNull(i, Position.RIGHT),
                      "depth of RIGHT side has not been initialized");
              lbl.setLocation(i, Position.RIGHT, depth
                  .getLocation(i, Position.RIGHT));
            }
          }
        }
      }
View Full Code Here

    // 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

   * 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
View Full Code Here

   */
  private void findResultAreaEdges(int opCode) {
    for (Iterator it = graph.getEdgeEnds().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      // mark all dirEdges with the appropriate label
      Label label = de.getLabel();
      if (label.isArea()
          && !de.isInteriorAreaEdge()
          && isResultOfOp(label.getLocation(0, Position.RIGHT), label
              .getLocation(1, Position.RIGHT), opCode)) {
        de.setInResult(true);
        // Debug.print("in result "); Debug.println(de);
      }
    }
View Full Code Here

   *            the overlap operation
   * @param edges
   *            the list of included line edges
   */
  private void collectLineEdge(DirectedEdge de, int opCode, List edges) {
    Label label = de.getLabel();
    Edge e = de.getEdge();
    // include L edges which are in the result
    if (de.isLineEdge()) {
      if (!de.isVisited() && OverlayOp.isResultOfOp(label, opCode)
          && !e.isCovered()) {
View Full Code Here

   * <li> OR as a result of a dimensional collapse.
   * </ul>
   */
  private void collectBoundaryTouchEdge(DirectedEdge de, int opCode,
      List edges) {
    Label label = de.getLabel();
    if (de.isLineEdge())
      return; // only interested in area edges
    if (de.isVisited())
      return; // already processed
    if (de.isInteriorAreaEdge())
View Full Code Here

  private void buildLines(int opCode) {

    for (Iterator it = this.lineEdgesList.iterator(); it.hasNext();) {

      Edge e = (Edge) it.next();
      Label label = e.getLabel();

            List<Position> positions = CoordinateArrays.toPositionList(crs, e
                    .getCoordinates());
      LineString line = new LineStringImpl(new PointArrayImpl( positions ), 0.0); //coordinateFactory.createLineString( positions );         
      LinkedList<CurveSegment> tLineStrings = new LinkedList<CurveSegment>();
View Full Code Here

  }

  private void labelIsolatedLines(List edgesList) {
    for (Iterator it = edgesList.iterator(); it.hasNext();) {
      Edge e = (Edge) it.next();
      Label label = e.getLabel();
      // n.print(System.out);
      if (e.isIsolated()) {
        if (label.isNull(0))
          labelIsolatedLine(e, 0);
        else
          labelIsolatedLine(e, 1);
      }
    }
View Full Code Here

        /**
         * 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

TOP

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

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.