Examples of fastDistance()


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

    private PartialStreetEdge makePartialEdgeAlong(StreetEdge e, StreetVertex u,
            StreetVertex v) {
        DistanceLibrary dLib = SphericalDistanceLibrary.getInstance();

        Vertex head = e.getFromVertex();
        double uDist = dLib.fastDistance(head.getCoordinate(), u.getCoordinate());
        double vDist = dLib.fastDistance(head.getCoordinate(), v.getCoordinate());

        // Order the vertices along the partial edge by distance from the head of the edge.
        // TODO(flamholz): this logic is insufficient for curvy streets/roundabouts.
        StreetVertex first = u;
View Full Code Here

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

            StreetVertex v) {
        DistanceLibrary dLib = SphericalDistanceLibrary.getInstance();

        Vertex head = e.getFromVertex();
        double uDist = dLib.fastDistance(head.getCoordinate(), u.getCoordinate());
        double vDist = dLib.fastDistance(head.getCoordinate(), v.getCoordinate());

        // Order the vertices along the partial edge by distance from the head of the edge.
        // TODO(flamholz): this logic is insufficient for curvy streets/roundabouts.
        StreetVertex first = u;
        StreetVertex second = v;
View Full Code Here

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

             */
            PatternHop bestHop = null;
            double minDist = Double.MAX_VALUE;
            for (PatternHop hop : hops) {
                LineString line = hop.getGeometry();
                double dist = distanceLibrary.fastDistance(point, line);
                if (dist < minDist) {
                    minDist = dist;
                    bestHop = hop;
                }
            }
View Full Code Here

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

            @Override
            public WTWD cumulateSample(Coordinate C0, Coordinate Cs, WTWD z, WTWD zS) {
                double t = z.wTime / z.w;
                double b = z.wBoardings / z.w;
                double wd = z.wWalkDist / z.w;
                double d = distanceLibrary.fastDistance(C0, Cs, cosLat);
                // additionnal time
                double dt = d / v0;
                // t weight
                double w = 1 / ((d + d0) * (d + d0));
                if (zS == null) {
View Full Code Here

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

        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.