Package org.geotools.geometry.iso.topograph2D

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


    Node node = new Node(key.getEnvelope(), key.getLevel());
    return node;
  }

  public static Node createExpanded(Node node, Envelope addEnv) {
    Envelope expandEnv = new Envelope(addEnv);
    if (node != null)
      expandEnv.expandToInclude(node.env);

    Node largerNode = createNode(expandEnv);
    if (node != null)
      largerNode.insertNode(node);
    return largerNode;
View Full Code Here


      maxx = env.getMaxX();
      miny = centre.y;
      maxy = env.getMaxY();
      break;
    }
    Envelope sqEnv = new Envelope(minx, maxx, miny, maxy);
    Node node = new Node(sqEnv, level - 1);
    return node;
  }
View Full Code Here

  private EdgeRing findEdgeRingContaining(EdgeRing testEr, List shellList) {

    Ring testRing = testEr.getRing();
    org.geotools.geometry.iso.coordinate.EnvelopeImpl env = (EnvelopeImpl) testRing
        .getEnvelope();
    Envelope testEnv = new Envelope(env.getLowerCorner().getOrdinate(X), env
        .getUpperCorner().getOrdinate(X), env.getLowerCorner().getOrdinate(Y), env
        .getUpperCorner().getOrdinate(Y));
    // Take a point on the ring to do the point in ring test
    DirectPosition dp = testRing.getRepresentativePoint();
    Coordinate testPt = new Coordinate(dp.getCoordinate());

    EdgeRing minShell = null;
    Envelope minEnv = null;
    for (Iterator it = shellList.iterator(); it.hasNext();) {
      EdgeRing tryShell = (EdgeRing) it.next();
      Ring tryRing = tryShell.getRing();

      env = (EnvelopeImpl) tryRing.getEnvelope();
      Envelope tryEnv = new Envelope(env.getLowerCorner().getOrdinate(X), env
          .getUpperCorner().getOrdinate(X), env.getLowerCorner().getOrdinate(Y), env
          .getUpperCorner().getOrdinate(Y));

      if (minShell != null) {
        env = (EnvelopeImpl) minShell.getRing().getEnvelope();
        minEnv = new Envelope(env.getLowerCorner().getOrdinate(X), env
            .getUpperCorner().getOrdinate(X), env.getLowerCorner().getOrdinate(Y),
            env.getUpperCorner().getOrdinate(Y));
      }

      boolean isContained = false;
      if (tryEnv.contains(testEnv)
          && CGAlgorithms.isPointInRing(testPt, CoordinateArrays
              .toCoordinateArray( (((RingImplUnsafe) tryRing).asDirectPositions()) ))) {
        isContained = true;
      }
      // check if this new containing ring is smaller than the current
View Full Code Here

   * return a square envelope containing the argument envelope, whose extent
   * is a power of two and which is based at a power of 2
   */
  public void computeKey(Envelope itemEnv) {
    level = computeQuadLevel(itemEnv);
    env = new Envelope();
    computeKey(level, itemEnv);
    // MD - would be nice to have a non-iterative form of this algorithm
    while (!env.contains(itemEnv)) {
      level += 1;
      computeKey(level, itemEnv);
View Full Code Here

    }
    if (miny == maxy) {
      miny = miny - minExtent / 2.0;
      maxy = miny + minExtent / 2.0;
    }
    return new Envelope(minx, maxx, miny, maxy);
  }
View Full Code Here

    return 0;
  }

  public void insert(Envelope itemEnv, Object item) {
    collectStats(itemEnv);
    Envelope insertEnv = ensureExtent(itemEnv, minExtent);
    root.insert(insertEnv, item);
  }
View Full Code Here

   * @param item
   *            the item to remove
   * @return <code>true</code> if the item was found
   */
  public boolean remove(Envelope itemEnv, Object item) {
    Envelope posEnv = ensureExtent(itemEnv, minExtent);
    return root.remove(posEnv, item);
  }
View Full Code Here

   *
   * @return <code>true</code> if the input point lies within both input
   *         segment envelopes
   */
  private boolean isInSegmentEnvelopes(Coordinate intPt) {
    Envelope env0 = new Envelope(inputLines[0][0], inputLines[0][1]);
    Envelope env1 = new Envelope(inputLines[1][0], inputLines[1][1]);
    return env0.contains(intPt) && env1.contains(intPt);
  }
View Full Code Here

TOP

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

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.