Package org.opentripplanner.common.geometry

Examples of org.opentripplanner.common.geometry.DistanceLibrary.distance()


        DistanceLibrary distanceLibrary = SphericalDistanceLibrary.getInstance();
        Coordinate fromc = fromv.getCoordinate();
        Coordinate toc = tov.getCoordinate();
        geometry = GeometryUtils.getGeometryFactory().createLineString(
                new Coordinate[] { fromc, toc });
        linkDistance = distanceLibrary.distance(fromc, toc);
    }

    @Override
    public String getName() {
        // TODO I18n
View Full Code Here


      for (int i = 0; i < N_TEST; i++) {
        double lat1 = r.nextDouble() * 2.0 * MAX_LAT - MAX_LAT;
        double lon1 = r.nextDouble() * 360.0;
        double lat2 = lat1 + r.nextDouble() * 2.0 * MAX_DELTA_LAT - MAX_DELTA_LAT;
        double lon2 = lon1 + r.nextDouble() * 2.0 * MAX_DELTA_LON - MAX_DELTA_LON;
        double de = distanceLibrary.distance(lat1, lon1, lat2, lon2);
        double da = distanceLibrary.fastDistance(lat1, lon1, lat2, lon2);
        assertTrue(da <= de);
        assertTrue(da >= de / 1.00054);
      }
    }
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.