Package org.onebusaway.transit_data_federation.services.transit_graph

Examples of org.onebusaway.transit_data_federation.services.transit_graph.StopEntry


      /**
       * Print the visited stop count as a show of progress
       */
      if (vertex instanceof HasStopTransitVertex) {
        HasStopTransitVertex v = (HasStopTransitVertex) vertex;
        StopEntry stop = v.getStop();
        if (_stops.add(stop) && _stops.size() % 100 == 0) {
          System.out.println("stops=" + _stops.size());
          if (_stops.size() == 13900)
            System.out.println("here");
        }
View Full Code Here


  private Segment getSegmentForStopSequence(StopSequence pattern) {

    Segment segment = new Segment();

    List<StopEntry> stops = pattern.getStops();
    StopEntry prev = null;

    for (StopEntry stop : stops) {
      if (prev == null) {
        segment.fromLat = stop.getStopLat();
        segment.fromLon = stop.getStopLon();
      } else {
        segment.distance += SphericalGeometryLibrary.distance(
            prev.getStopLat(), prev.getStopLon(), stop.getStopLat(),
            stop.getStopLon());
      }
      segment.toLat = stop.getStopLat();
      segment.toLon = stop.getStopLon();
      prev = stop;
View Full Code Here

        // No contination if the the block group ids don't match
        String prevGroupId = stopSequenceGroupIds.get(prevSequence);
        if (!groupId.equals(prevGroupId))
          continue;

        StopEntry prevStop = prevSequence.getStops().get(
            prevSequence.getStops().size() - 1);
        StopEntry nextStop = sequence.getStops().get(0);
        double d = SphericalGeometryLibrary.distance(prevStop.getStopLat(),
            prevStop.getStopLon(), nextStop.getStopLat(), nextStop.getStopLon());
        if (d < 5280 / 4) {
          /*
           * System.out.println("distance=" + d + " from=" + prevStop.getId() +
           * " to=" + nextStop.getId() + " ssFrom=" + prevSequence.getId() +
           * " ssTo=" + stopSequence.getId());
View Full Code Here

  }

  private Set<Pair<StopEntry>> getStopSequenceAsStopPairSet(
      StopSequence stopSequence) {
    Set<Pair<StopEntry>> pairs = new HashSet<Pair<StopEntry>>();
    StopEntry prev = null;
    for (StopEntry stop : stopSequence.getStops()) {
      if (prev != null) {
        Pair<StopEntry> pair = Tuples.pair(prev, stop);
        pairs.add(pair);
      }
View Full Code Here

      for( RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
        for( RouteEntry route : routeCollection.getChildren() ) {
          for (TripEntry trip : route.getTrips() ) {
            for( StopTimeEntry stopTime : trip.getStopTimes() ) {
              StopEntry stop = stopTime.getStop();
              centerOfMass.lats += stop.getStopLat();
              centerOfMass.lons += stop.getStopLon();
              centerOfMass.count++;
            }
          }
        }
      }
View Full Code Here

     
      for( RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
        for( RouteEntry route : routeCollection.getChildren() ) {
          for (TripEntry trip : route.getTrips() ) {
            for( StopTimeEntry stopTime : trip.getStopTimes() ) {
              StopEntry stop = stopTime.getStop();
              bounds.addPoint(stop.getStopLat(), stop.getStopLon());
            }
          }
        }
      }
View Full Code Here

  @Override
  public List<ServiceDateSummary> getServiceDateSummariesForStop(
      AgencyAndId stopId, boolean includePrivateService) {

    StopEntry stop = _transitGraphDao.getStopEntryForId(stopId, true);

    Set<ServiceIdActivation> allServiceIds = getAllServiceIdsForStop(stop,
        includePrivateService);

    Map<ServiceDate, Set<ServiceIdActivation>> serviceIdsByDate = new FactoryMap<ServiceDate, Set<ServiceIdActivation>>(
View Full Code Here

      TripStopTimeBean stBean = new TripStopTimeBean();

      stBean.setArrivalTime(stopTime.getArrivalTime());
      stBean.setDepartureTime(stopTime.getDepartureTime());

      StopEntry stopEntry = stopTime.getStop();
      StopBean stopBean = _stopBeanService.getStopForId(stopEntry.getId());
      stBean.setStop(stopBean);
      stBean.setDistanceAlongTrip(stopTime.getShapeDistTraveled());
      bean.addStopTime(stBean);
    }
View Full Code Here

  }

  @Cacheable
  public StopBean getStopForId(AgencyAndId id) {

    StopEntry stop = _transitGraphDao.getStopEntryForId(id);
    StopNarrative narrative = _narrativeService.getStopForId(id);

    if (stop == null)
      throw new NoSuchStopServiceException(
          AgencyAndIdLibrary.convertToString(id));
View Full Code Here

    Map<StopEntry, List<TransferParent>> parentsByHubStop = new FactoryMap<StopEntry, List<TransferParent>>(
        new ArrayList<TransferParent>());

    for (int index = _hubOffset; index < _stopIndices.length; index++) {
      StopEntry hubStop = _allStops.get(_stopIndices[index]);
      int leafIndex = _parentIndices[index];
      TransferParent parent = getTransferForLeafIndex(leafIndex, false, root);
      parentsByHubStop.get(hubStop).add(parent);
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.StopEntry

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.