Package org.onebusaway.gtfs.model

Examples of org.onebusaway.gtfs.model.Stop


    public final void testStreetfulStopLinker() {
        final double speed = new RoutingRequest().walkSpeed;

        Graph graph = new Graph();

        Stop stopA = new Stop();
        Stop stopB = new Stop();
        Stop stopC = new Stop();
        Stop stopD = new Stop();
        Stop stopE = new Stop();

        stopA.setId(new AgencyAndId("Stop", "A"));
        stopA.setLon(0);
        stopA.setLat(0);
        stopB.setId(new AgencyAndId("Stop", "B"));
        stopB.setLon(0);
        stopB.setLat(3);
        stopC.setId(new AgencyAndId("Stop", "C"));
        stopC.setLon(3);
        stopC.setLat(3);
        stopD.setId(new AgencyAndId("Stop", "D"));
        stopD.setLon(3);
        stopD.setLat(0);
        stopE.setId(new AgencyAndId("Stop", "E"));
        stopE.setLon(2);
        stopE.setLat(2);

        TransitStop transitStopA = new TransitStop(graph, stopA);
        TransitStop transitStopB = new TransitStop(graph, stopB);
        TransitStop transitStopC = new TransitStop(graph, stopC);
        TransitStop transitStopD = new TransitStop(graph, stopD);
View Full Code Here


        leftBack = new StreetEdge(tl, bl, (LineString) left.getGeometry().reverse(),
                "leftBack", 1500, StreetTraversalPermission.ALL, true);
        rightBack = new StreetEdge(tr, br, (LineString) right.getGeometry().reverse(),
                "rightBack", 1500, StreetTraversalPermission.ALL, true);

        Stop s1 = new Stop();
        s1.setName("transitVertex 1");
        s1.setLon(-74.005);
        s1.setLat(40.0099999);
        s1.setId(new AgencyAndId("A", "fleem station"));

        Stop s2 = new Stop();
        s2.setName("transitVertex 2");
        s2.setLon(-74.002);
        s2.setLat(40.0099999);
        s2.setId(new AgencyAndId("A", "morx station"));

        station1 = new TransitStop(graph, s1);
        station2 = new TransitStop(graph, s2);
        station1.addMode(TraverseMode.RAIL);
        station2.addMode(TraverseMode.RAIL);
View Full Code Here

        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(3);
        StopTime stopDepartTime = new StopTime();
        StopTime stopDwellTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
        Stop stopDepart = new Stop();
        Stop stopDwell = new Stop();
        Stop stopArrive = new Stop();
        Trip trip = new Trip();

        routingContext.serviceDays =
                new ArrayList<ServiceDay>(Collections.singletonList(serviceDay));
        route.setId(agencyAndId);
        stopDepart.setId(agencyAndId);
        stopDwell.setId(agencyAndId);
        stopArrive.setId(agencyAndId);
        stopDepartTime.setStop(stopDepart);
        stopDepartTime.setDepartureTime(0);
        stopDwellTime.setArrivalTime(20);
        stopDwellTime.setStop(stopDwell);
        stopDwellTime.setDepartureTime(40);
View Full Code Here

        AgencyAndId agencyAndId = new AgencyAndId("Agency", "ID");
        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(2);
        StopTime stopDepartTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
        Stop stopDepart = new Stop();
        Stop stopArrive = new Stop();
        Trip trip = new Trip();

        routingContext.serviceDays =
                new ArrayList<ServiceDay>(Collections.singletonList(serviceDay));
        route.setId(agencyAndId);
        stopDepart.setId(new AgencyAndId("Station", "0"));
        stopArrive.setId(new AgencyAndId("Station", "1"));
        stopDepartTime.setStop(stopDepart);
        stopDepartTime.setDepartureTime(0);
        stopArriveTime.setArrivalTime(10);
        stopArriveTime.setStop(stopArrive);
        stopTimes.add(stopDepartTime);
View Full Code Here

        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(2);
        StopTime stopDepartTime = new StopTime();
        StopTime stopDwellTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
        Stop stopDepart = new Stop();
        Stop stopDwell = new Stop();
        Stop stopArrive = new Stop();
        Trip trip = new Trip();

        routingContext.serviceDays =
                new ArrayList<ServiceDay>(Collections.singletonList(serviceDay));
        route.setId(agencyAndId);
        stopDepart.setId(new AgencyAndId("Station", "0"));
        stopDwell.setId(new AgencyAndId("Station", "1"));
        stopArrive.setId(new AgencyAndId("Station", "2"));
        stopDepartTime.setStop(stopDepart);
        stopDepartTime.setDepartureTime(0);
        stopDwellTime.setArrivalTime(20);
        stopDwellTime.setStop(stopDwell);
        stopDwellTime.setDepartureTime(40);
View Full Code Here

    public void testIdLookup() {

        /* Graph vertices */
        for (Vertex vertex : graph.index.vertexForId.values()) {
            if (vertex instanceof TransitStop) {
                Stop stop = ((TransitStop)vertex).getStop();
                Vertex index_vertex = graph.index.stopVertexForStop.get(stop);
                assertEquals(index_vertex, vertex);
            }
        }

View Full Code Here

            }
        }
    }

    public void testSpatialIndex() {
        Stop stopJ = graph.index.stopForId.get(new AgencyAndId("agency", "J"));
        Stop stopL = graph.index.stopForId.get(new AgencyAndId("agency", "L"));
        Stop stopM = graph.index.stopForId.get(new AgencyAndId("agency", "M"));
        TransitStop stopvJ = graph.index.stopVertexForStop.get(stopJ);
        TransitStop stopvL = graph.index.stopVertexForStop.get(stopL);
        TransitStop stopvM = graph.index.stopVertexForStop.get(stopM);
        // There are a two other stops within 100 meters of stop J.
        Envelope env = new Envelope(new Coordinate(stopJ.getLon(), stopJ.getLat()));
View Full Code Here

        // Create StopMatcher instance
        StopMatcher stopMatcher = StopMatcher.parse("TriMet:2106,TriMet:65-tc");
        // Find stops in graph
        Graph graph = Context.getInstance().graph;

        Stop stop65_tc = ((TransitStationStop) graph.getVertex("TriMet:65-tc")).getStop();
        assertNotNull(stop65_tc);

        Stop stop12921 = ((TransitStationStop) graph.getVertex("TriMet:12921")).getStop();
        assertNotNull(stop12921);

        Stop stop13132 = ((TransitStationStop) graph.getVertex("TriMet:13132")).getStop();
        assertNotNull(stop13132);

        Stop stop2106 = ((TransitStationStop) graph.getVertex("TriMet:2106")).getStop();
        assertNotNull(stop2106);

        Stop stop2107 = ((TransitStationStop) graph.getVertex("TriMet:2107")).getStop();
        assertNotNull(stop2107);

        // Match stop with id 65-tc
        assertTrue(stopMatcher.matches(stop65_tc));
        // Match stop with id 12921 that has TriMet:65-tc as a parent
View Full Code Here

     * Add a trip-to-trip transfer time to a transfer table and check the result
     */
    private void addTripToTripTransferTimeToTable(TransferTable table, String fromStopId,
            String toStopId, String fromRouteId, String toRouteId, String fromTripId,
            String toTripId, int transferTime) {
        Stop fromStop = new Stop();
        fromStop.setId(new AgencyAndId("TriMet", fromStopId));
        Stop toStop = new Stop();
        toStop.setId(new AgencyAndId("TriMet", toStopId));
        Route fromRoute = new Route();
        fromRoute.setId(new AgencyAndId("TriMet", fromRouteId));
        Route toRoute = new Route();
        toRoute.setId(new AgencyAndId("TriMet", toRouteId));
        Trip fromTrip = new Trip();
View Full Code Here

    /**
     * Add a stop-to-stop transfer time to a transfer table and check the result
     */
    private void addStopToStopTransferTimeToTable(TransferTable table, String fromStopId,
            String toStopId, int transferTime) {
        Stop fromStop = new Stop();
        fromStop.setId(new AgencyAndId("TriMet", fromStopId));
        Stop toStop = new Stop();
        toStop.setId(new AgencyAndId("TriMet", toStopId));
        Route fromRoute = new Route();
        fromRoute.setId(new AgencyAndId("TriMet", "dummy"));
        Route toRoute = new Route();
        toRoute.setId(new AgencyAndId("TriMet", "dummy"));
        Trip fromTrip = new Trip();
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.model.Stop

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.