Package org.onebusaway.gtfs.model

Examples of org.onebusaway.gtfs.model.Stop


    trip.setServiceId(new AgencyAndId("1", "serviceId"));
    trip.setShapeId(shapeId);
    Mockito.when(gtfsDao.getTripsForRoute(route)).thenReturn(
        Arrays.asList(trip));

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));

    StopTime stA = new StopTime();
    stA.setId(100);
    stA.setArrivalTime(time(9, 00));
    stA.setDepartureTime(time(9, 05));
    stA.setStopSequence(100);
    stA.setStop(stopA);
    stA.setTrip(trip);

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));

    StopTime stB = new StopTime();
    stB.setId(101);
    stB.setArrivalTime(time(10, 00));
    stB.setDepartureTime(time(10, 05));
View Full Code Here


  @Test
  public void testDuplicateRemoval() {

    TransitGraphImpl graph = new TransitGraphImpl();

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));
    graph.putStopEntry(stop("stopA", 47.672207391799056, -122.387855896286));

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));
    graph.putStopEntry(stop("stopB", 47.66852277218285, -122.3853882639923));

    Stop stopC = new Stop();
    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
View Full Code Here

  @Test
  public void testThreeInARowDuplicateRemoval() {

    TransitGraphImpl graph = new TransitGraphImpl();

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));
    graph.putStopEntry(stop("stopA", 47.672207391799056, -122.387855896286));

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));
    graph.putStopEntry(stop("stopB", 47.66852277218285, -122.3853882639923));

    Stop stopC = new Stop();
    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    Stop stopD = new Stop();
    stopD.setId(aid("stopD"));
    graph.putStopEntry(stop("stopD", 47.66947942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
View Full Code Here

  @Test
  public void test() {

    TransitGraphImpl graph = new TransitGraphImpl();

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));
    graph.putStopEntry(stop("stopA", 47.672207391799056, -122.387855896286));

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));
    graph.putStopEntry(stop("stopB", 47.66852277218285, -122.3853882639923));

    Stop stopC = new Stop();
    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
View Full Code Here

        stopTimes.size());
    int sequence = 0;

    for (StopTime stopTime : stopTimes) {

      Stop stop = stopTime.getStop();
      AgencyAndId stopId = stop.getId();
      StopEntryImpl stopEntry = graph.getStopEntryForId(stopId);

      StopTimeEntryImpl stopTimeEntry = new StopTimeEntryImpl();

      stopTimeEntry.setId(stopTime.getId());
View Full Code Here

        /**
         * The previous stop time's departure time comes AFTER this stop time's
         * arrival time. That's bad.
         */
        StopTime prevStopTime = stopTimes.get(i - 1);
        Stop prevStop = prevStopTime.getStop();
        Stop stop = stopTime.getStop();

        if (prevStop.equals(stop)
            && arrivalTimes[i] == departureTimes[i - 1] - 1) {
          _log.info("fixing decreasing passingTimes: stopTimeA="
              + prevStopTime.getId() + " stopTimeB=" + stopTime.getId());
View Full Code Here

      if (index % 10 == 0)
        _log.info("stops=" + index);
      index++;

      Stop stop = stopsById.get(stopEntry.getId());

      StopNarrative.Builder narrative = StopNarrative.builder();
      narrative.setCode(deduplicate(stop.getCode()));
      narrative.setDescription(deduplicate(stop.getDesc()));
      narrative.setName(deduplicate(stop.getName()));
      narrative.setUrl(deduplicate(stop.getUrl()));

      String direction = computeStopDirection(provider, shapePointCache, stop,
          stopEntry);
      narrative.setDirection(deduplicate(direction));
View Full Code Here

    }

    @Override
    public void handleEntity(Object bean) {

      Stop stop = (Stop) bean;

      if (_bounds.contains(stop.getLat(), stop.getLon()))
        System.out.println(stop.getLat() + " " + stop.getLon() + " "
            + stop.getId());
    }
View Full Code Here

    }

    @Override
    public void handleEntity(Object bean) {

      Stop stop = (Stop) bean;

      Point point = _factory.createPoint(new Coordinate(stop.getLat(),stop.getLon()));
      if (_geometry.contains(point))
        System.out.println(stop.getLat() + " " + stop.getLon() + " "
            + stop.getId());
    }
View Full Code Here

    }

    @Override
    public void handleEntity(Object bean) {

      Stop stop = (Stop) bean;

      if (_projection == null) {
        int zone = UTMLibrary.getUTMZoneForLongitude(stop.getLon());
        _projection = new UTMProjection(zone);
      }

      XYPoint point = _projection.forward(new CoordinatePoint(stop.getLat(),
          stop.getLon()));

      Point p = _factory.createPoint(new Coordinate(point.getX(), point.getY()));
      Geometry geometry = p.buffer(_bufferRadiusInMeters).getEnvelope();

      if (_geometry == null)
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.