Package org.geomajas.gwt.client.spatial

Examples of org.geomajas.gwt.client.spatial.LineSegment


    Coordinate snappingPoint = null;
    double currThreshold = threshold;

    for (Coordinate[] coordinateArray : coordinates) {
      for (int j = 1; j < coordinateArray.length; j++) {
        LineSegment line = new LineSegment(coordinateArray[j], coordinateArray[j - 1]);
        double distance = line.distance(original);
        if (distance < currThreshold && distance < ruleDistance) {
          currThreshold = distance;
          minimumDistance = distance;
          snappingPoint = line.nearest(original);
        }
      }
    }

    return snappingPoint;
View Full Code Here


  public double getDistance(Coordinate coordinate) {
    double distance = Double.MAX_VALUE;
    if (!isEmpty()) {
      for (Point point : points) {
        double temp = new LineSegment(point.getCoordinate(), coordinate).getLength();
        if (temp < distance) {
          distance = temp;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.spatial.LineSegment

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.