Package org.geotools.geometry.iso.topograph2D

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


   *
   * @param edges
   */
  private void insertUniqueEdges(List edges) {
    for (Iterator i = edges.iterator(); i.hasNext();) {
      Edge e = (Edge) i.next();
      this.insertUniqueEdge(e);
    }
  }
View Full Code Here


   * not inserted, but its label is merged with the existing edge.
   */
  protected void insertUniqueEdge(Edge e) {
    // <FIX> MD 8 Oct 03 speed up identical edge lookup
    // 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
      // /*
      if (depth.isNull()) {
        depth.add(existingLabel);
View Full Code Here

   * (i.e. a depth of 0 corresponds to a Location of EXTERIOR, a depth of 1
   * 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()) {
View Full Code Here

   * them with a new edge which is a L edge
   */
  private void replaceCollapsedEdges() {
    List newEdges = new ArrayList();
    for (Iterator it = edgeList.iterator(); it.hasNext();) {
      Edge e = (Edge) it.next();
      if (e.isCollapsed()) {
        // Debug.print(e);
        it.remove();
        newEdges.add(e.getCollapsedEdge());
      }
    }
    edgeList.addAll(newEdges);
  }
View Full Code Here

     * For all L edges which weren't handled by the above, use a
     * point-in-poly test to determine whether they are covered
     */
    for (Iterator it = op.getGraph().getEdgeEnds().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      Edge e = de.getEdge();
      if (de.isLineEdge() && !e.isCoveredSet()) {
        boolean isCovered = op.isCoveredByA(de.getCoordinate());
        e.setCovered(isCovered);
      }
    }
  }
View Full Code Here

   * @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()) {
        // Debug.println("de: " + de.getLabel());
        // Debug.println("edge: " + e.getLabel());

        edges.add(e);
        de.setVisitedEdge(true);
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>();
      tLineStrings.add((CurveSegment) line);
      CurveImpl curve = new CurveImpl(crs, (List<CurveSegment>) tLineStrings); //primitiveFactory.createCurve((List<CurveSegment>) tLineStrings);
      resultLineList.add(curve);
      e.setInResult(true);

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

   * endpoint. The Geometry is not simple if there are intersections not at
   * endpoints.
   */
  private boolean hasNonEndpointIntersection(GeometryGraph graph) {
    for (Iterator i = graph.getEdgeIterator(); i.hasNext();) {
      Edge e = (Edge) i.next();
      int maxSegmentIndex = e.getMaximumSegmentIndex();
      for (Iterator eiIt = e.getEdgeIntersectionList().iterator(); eiIt
          .hasNext();) {
        EdgeIntersection ei = (EdgeIntersection) eiIt.next();
        if (!ei.isEndPoint(maxSegmentIndex))
          return true;
      }
View Full Code Here

   * closed lines must be exactly 2.
   */
  private boolean hasClosedEndpointIntersection(GeometryGraph graph) {
    Map endPoints = new TreeMap();
    for (Iterator i = graph.getEdgeIterator(); i.hasNext();) {
      Edge e = (Edge) i.next();
      int maxSegmentIndex = e.getMaximumSegmentIndex();
      boolean isClosed = e.isClosed();
      Coordinate p0 = e.getCoordinate(0);
      addEndpoint(endPoints, p0, isClosed);
      Coordinate p1 = e.getCoordinate(e.getNumPoints() - 1);
      addEndpoint(endPoints, p1, isClosed);
    }

    for (Iterator i = endPoints.values().iterator(); i.hasNext();) {
      EndpointInfo eiInfo = (EndpointInfo) i.next();
View Full Code Here

TOP

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

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.