Package org.opentripplanner.common.model

Examples of org.opentripplanner.common.model.GenericLocation


        IsoChroneRequest isoChroneRequest = new IsoChroneRequest(cutoffSecList);
        isoChroneRequest.includeDebugGeometry = debug;
        isoChroneRequest.precisionMeters = precisionMeters;
        if (coordinateOrigin != null)
            isoChroneRequest.coordinateOrigin = new GenericLocation(null, coordinateOrigin)
                    .getCoordinate();
        RoutingRequest sptRequest = buildRequest(0);

        if (maxTimeSec != null) {
            isoChroneRequest.maxTimeSec = maxTimeSec;
View Full Code Here


        JButton snapButton = new JButton("Snap location");
        snapButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                String locString = (String) JOptionPane.showInputDialog(frame, "Location string",
                        "");
                GenericLocation loc = GenericLocation.fromOldStyleString(locString);
                RoutingRequest rr = new RoutingRequest();
                Vertex v = graph.streetIndex.getVertexForLocation(
                        loc, rr);
                showGraph.highlightVertex(v);
            }
View Full Code Here

        score = calcScore(mode);
    }

    /** Construct CandidateEdge based on a Coordinate. */
    public CandidateEdge(StreetEdge e, Coordinate p, double pref, TraverseModeSet mode) {
        this(e, new GenericLocation(p), pref, mode);
    }
View Full Code Here

                }
            }
        }
       
        // TODO make this work as either to or from query
        GenericLocation from = spt.getOptions().from;
        this.lon = from.lng;
        this.lat = from.lat;
        this.id = makeUniqueId();
        this.dateTime = spt.getOptions().dateTime;
        long t1 = System.currentTimeMillis();
View Full Code Here

import static org.opentripplanner.routing.core.TraverseMode.CUSTOM_MOTOR_VEHICLE;

public class RoutingRequestTest {

    private GenericLocation randomLocation() {
        return new GenericLocation(Math.random(), Math.random());
    }
View Full Code Here

        RoutingRequest sptRequest = buildRequest(0);
        SampleGridRequest tgRequest = new SampleGridRequest();
        tgRequest.maxTimeSec = maxTimeSec;
        tgRequest.precisionMeters = precisionMeters;
        if (coordinateOrigin != null)
            tgRequest.coordinateOrigin = new GenericLocation(null, coordinateOrigin)
                    .getCoordinate();

        // Get a sample grid
        ZSampleGrid<WTWD> sampleGrid = sampleGridRenderer.getSampleGrid(tgRequest, sptRequest);
        int cols = sampleGrid.getXMax() - sampleGrid.getXMin() + 1;
View Full Code Here

        else
            vertexLabel = "link for " + v;
        Coordinate coordinate = v.getCoordinate();

        /* is there a bundle of edges nearby to use or split? */
        GenericLocation location = new GenericLocation(coordinate);
        TraversalRequirements reqs = new TraversalRequirements(options);
        CandidateEdgeBundle edges = linker.index.getClosestEdges(location, reqs, null,
                nearbyRouteEdges, possibleTransitLinksOnly);
        if (edges == null || edges.size() < 1) {
            // no edges were found nearby, or a bidirectional/loop bundle of edges was not identified
View Full Code Here

    @Test
    public void testModeRestriction() {
        // Lies along the top right edge
        Coordinate c = new Coordinate(-74.005000001, 40.01);
        GenericLocation loc = new GenericLocation(c);
        TraversalRequirements reqs = new TraversalRequirements();

        // Default traversal requirements allow any traversal mode.
        checkClosestEdgeModes(loc, reqs, 1);
View Full Code Here

    @Test
    public void testInteriorEdgeCase() {
        // Lies smack in the middle of the box
        Coordinate c = new Coordinate(-74.005, 40.005);
        GenericLocation loc = new GenericLocation(c);
        TraversalRequirements reqs = new TraversalRequirements();

        // Should only return 2 edges even though all edges are equidistant.
        // TODO(flamholz): this doesn't feel like the right behavior to me.
        // Consider fixing it.
View Full Code Here

        reqs.modes = modes;
       
        for (double degreeOff = 0.0; degreeOff < 30.0; degreeOff += 3.0) {
            // Location along the top edge, traveling with the forward edge
            // exactly.
            GenericLocation loc = new GenericLocation(c);
            loc.heading = top.getAzimuth() + degreeOff;

            // The top edge should be returned in all cases.
            checkBest(reqs, loc, top, 2);
View Full Code Here

TOP

Related Classes of org.opentripplanner.common.model.GenericLocation

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.