Examples of EdgeRing


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

      if (er.getMaxNodeDegree() > 2) {
        er.linkDirectedEdgesForMinimalEdgeRings();
        List minEdgeRings = er.buildMinimalRings();
        // at this point we can go ahead and attempt to place holes, if
        // this EdgeRing is a polygon
        EdgeRing shell = findShell(minEdgeRings);
        if (shell != null) {
          placePolygonHoles(shell, minEdgeRings);
          shellList.add(shell);
        } else {
          freeHoleList.addAll(minEdgeRings);
View Full Code Here

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

   * @return the shell EdgeRing, if there is one
   * @return null, if all the rings are holes
   */
  private EdgeRing findShell(List minEdgeRings) {
    int shellCount = 0;
    EdgeRing shell = null;
    for (Iterator it = minEdgeRings.iterator(); it.hasNext();) {
      EdgeRing er = (MinimalEdgeRing) it.next();
      if (!er.isHole()) {
        shell = er;
        shellCount++;
      }
    }
    Assert.isTrue(shellCount <= 1,
View Full Code Here

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

   * otherwise.
   */
  private void sortShellsAndHoles(List edgeRings, List shellList,
      List freeHoleList) {
    for (Iterator it = edgeRings.iterator(); it.hasNext();) {
      EdgeRing er = (EdgeRing) it.next();
      // er.setInResult();
      if (er.isHole()) {
        freeHoleList.add(er);
      } else {
        shellList.add(er);
      }
    }
View Full Code Here

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

   * their parent shell) would have formed part of a MaximalEdgeRing and been
   * handled in a previous step).
   */
  private void placeFreeHoles(List shellList, List freeHoleList) {
    for (Iterator it = freeHoleList.iterator(); it.hasNext();) {
      EdgeRing hole = (EdgeRing) it.next();
      // only place this hole if it doesn't yet have a shell
      if (hole.getShell() == null) {
        EdgeRing shell = findEdgeRingContaining(hole, shellList);
        Assert
            .isTrue(shell != null,
                "unable to assign hole to a shell");
        hole.setShell(shell);
      }
View Full Code Here

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

        .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));
View Full Code Here

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

  private List computeSurfaces(List shellList) {
    List resultPolyList = new ArrayList();
    // add Polygons for all shells
    for (Iterator it = shellList.iterator(); it.hasNext();) {
      EdgeRing er = (EdgeRing) it.next();

      SurfaceImpl poly = er.toPolygon();
      resultPolyList.add(poly);
    }
    return resultPolyList;
  }
View Full Code Here

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

   * Checks the current set of shells (with their associated holes) to see if
   * any of them contain the point.
   */
  public boolean containsPoint(Coordinate p) {
    for (Iterator it = shellList.iterator(); it.hasNext();) {
      EdgeRing er = (EdgeRing) it.next();
      if (er.containsPoint(p))
        return true;
    }
    return false;
  }
View Full Code Here

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

  public List buildMinimalRings() {
    List minEdgeRings = new ArrayList();
    DirectedEdge de = startDe;
    do {
      if (de.getMinEdgeRing() == null) {
        EdgeRing minEr = new MinimalEdgeRing(de,
            super.crs, cga);
        minEdgeRings.add(minEr);
      }
      de = de.getNext();
    } while (de != startDe);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.