Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.LineSegment.distance()


  /**
   * returns the closest distance between point p and line segment s
   */
  public static final double distanceFromLineSegment(VectorXZ p, LineSegmentXZ s) {
    LineSegment sJTS = new LineSegment(s.p1.x, s.p1.z, s.p2.x, s.p2.z);
    return sJTS.distance(new Coordinate(p.x, p.z));
  }

  /**
   * returns a sequence of vectors at a distance above an original sequence
   *
 
View Full Code Here


                    // or if we're in tolerant mode
                    if(intersectionNum == LineIntersector.POINT_INTERSECTION || (tolerant && intersectionNum != LineIntersector.COLLINEAR)) {
                        // this one might be due to a numerical issue, where the two lines to do intersect
                        // exactly, but almost. Let's compute the distance and see
                        LineSegment segment = new LineSegment(o1, o2);
                        double d1 = segment.distance(c1);
                        double d2 = segment.distance(c2);
                        if(d1 <= PointDistance.EPS_METERS && d2 <= PointDistance.EPS_METERS) {
                            intersectionNum = LineIntersector.COLLINEAR;
                        }
                    }
View Full Code Here

                    if(intersectionNum == LineIntersector.POINT_INTERSECTION || (tolerant && intersectionNum != LineIntersector.COLLINEAR)) {
                        // this one might be due to a numerical issue, where the two lines to do intersect
                        // exactly, but almost. Let's compute the distance and see
                        LineSegment segment = new LineSegment(o1, o2);
                        double d1 = segment.distance(c1);
                        double d2 = segment.distance(c2);
                        if(d1 <= PointDistance.EPS_METERS && d2 <= PointDistance.EPS_METERS) {
                            intersectionNum = LineIntersector.COLLINEAR;
                        }
                    }
                    if(intersectionNum == LineIntersector.COLLINEAR) {
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.