Examples of nearestPoints()


Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

      DistanceOp distOp = new DistanceOp(A, B);

      double distance = distOp.distance();
      System.out.println("Distance = " + distance);

      Coordinate[] closestPt = distOp.nearestPoints();
      LineString closestPtLine = fact.createLineString(closestPt);
      System.out.println("Closest points: " + closestPtLine
                         + " (distance = " + closestPtLine.getLength() + ")");
    }
    catch (Exception ex) {
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

  private void doNearestPointsTest(String wkt0, String wkt1, double distance,
                                   Coordinate p0, Coordinate p1) throws ParseException {
    DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

  private void doNearestPointsTest(String wkt0, String wkt1, double distance,
                                   Coordinate p0, Coordinate p1) throws ParseException {
    DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

  private void doNearestPointsTest(String wkt0, String wkt1, double distance,
                                   Coordinate p0, Coordinate p1) throws ParseException {
    DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
}
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

                                   Coordinate p0, Coordinate p1) throws ParseException {
    DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
}
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

    DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
}
View Full Code Here

Examples of com.vividsolutions.jts.operation.distance.DistanceOp.nearestPoints()

    double tolerance = 1E-10;
    assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
    assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
    assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
    assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
    assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);   
 
}
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.