Package org.geotools.geometry.iso.topograph2D

Examples of org.geotools.geometry.iso.topograph2D.Coordinate$DimensionalComparator


   * @return <code>true</code> if the two arrays are equal in opposite
   *         directions.
   */
  private static boolean isEqualReversed(Coordinate[] pts1, Coordinate[] pts2) {
    for (int i = 0; i < pts1.length; i++) {
      Coordinate p1 = pts1[i];
      Coordinate p2 = pts2[pts1.length - i - 1];
      if (p1.compareTo(p2) != 0)
        return false;
    }
    return true;
  }
View Full Code Here


   * @return a deep copy of the input
   */
  public static Coordinate[] copyDeep(Coordinate[] coordinates) {
    Coordinate[] copy = new Coordinate[coordinates.length];
    for (int i = 0; i < coordinates.length; i++) {
      copy[i] = new Coordinate(coordinates[i]);
    }
    return copy;
  }
View Full Code Here

   */
  public static void reverse(Coordinate[] coord) {
    int last = coord.length - 1;
    int mid = last / 2;
    for (int i = 0; i <= mid; i++) {
      Coordinate tmp = coord[i];
      coord[i] = coord[last - i];
      coord[last - i] = tmp;
    }
  }
View Full Code Here

   * @return the minimum coordinate in the array, found using
   *         <code>compareTo</code>
   * @see Coordinate#compareTo(Object)
   */
  public static Coordinate minCoordinate(Coordinate[] coordinates) {
    Coordinate minCoord = null;
    for (int i = 0; i < coordinates.length; i++) {
      if (minCoord == null || minCoord.compareTo(coordinates[i]) > 0) {
        minCoord = coordinates[i];
      }
    }
    return minCoord;
  }
View Full Code Here

      List<DirectPosition> aPositions) {

    Coordinate[] rCoords = new Coordinate[aPositions.size()];

    for (int i = 0; i < aPositions.size(); i++) {
      rCoords[i] = new Coordinate(aPositions.get(i).getCoordinate());
    }

    return rCoords;

  }
View Full Code Here

      // if at the start of the edge there is no previous edge
      if (iPrev == 0)
        return;
      iPrev--;
    }
    Coordinate pPrev = edge.getCoordinate(iPrev);
    // if prev intersection is past the previous vertex, use it instead
    if (eiPrev != null && eiPrev.segmentIndex >= iPrev)
      pPrev = eiPrev.coord;

    Label label = new Label(edge.getLabel());
View Full Code Here

    int iNext = eiCurr.segmentIndex + 1;
    // if there is no next edge there is nothing to do
    if (iNext >= edge.getNumPoints() && eiNext == null)
      return;

    Coordinate pNext = edge.getCoordinate(iNext);

    // if the next intersection is in the same segment as the current, use
    // it as the endpoint
    if (eiNext != null && eiNext.segmentIndex == eiCurr.segmentIndex)
      pNext = eiNext.coord;
View Full Code Here

    HCoordinate l1 = new HCoordinate(new HCoordinate(p1), new HCoordinate(
        p2));
    HCoordinate l2 = new HCoordinate(new HCoordinate(q1), new HCoordinate(
        q2));
    HCoordinate intHCoord = new HCoordinate(l1, l2);
    Coordinate intPt = intHCoord.getCoordinate();
    return intPt;
  }
View Full Code Here

    }
    return a;
  }

  public Coordinate getCoordinate() throws NotRepresentableException {
    Coordinate p = new Coordinate();
    p.x = getX();
    p.y = getY();
    return p;
  }
View Full Code Here

     * must intersect.
     */
    if (Pq1 == 0 || Pq2 == 0 || Qp1 == 0 || Qp2 == 0) {
      isProper = false;
      if (Pq1 == 0) {
        intPt[0] = new Coordinate(q1);
      }
      if (Pq2 == 0) {
        intPt[0] = new Coordinate(q2);
      }
      if (Qp1 == 0) {
        intPt[0] = new Coordinate(p1);
      }
      if (Qp2 == 0) {
        intPt[0] = new Coordinate(p2);
      }
    } else {
      isProper = true;
      intPt[0] = intersection(p1, p2, q1, q2);
    }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.iso.topograph2D.Coordinate$DimensionalComparator

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.