private Set<String> getRouteIdsForMatchingRoutes() { StopsWithArrivalsAndDeparturesBean result = _model.getResult(); Set<String> ids = new HashSet<String>(); for (StopBean stop : result.getStops()) { for (RouteBean route : stop.getRoutes()) { if (route.getShortName().equals(_route)) ids.add(route.getId()); } } return ids; } }
/**** * Private Methods ****/ private RoutesBean getRoutesWithoutRouteNameQuery(SearchQueryBean query) { CoordinateBounds bounds = query.getBounds(); List<AgencyAndId> stops = _whereGeospatialService.getStopsByBounds(bounds); Set<RouteBean> routes = new HashSet<RouteBean>(); for (AgencyAndId stopId : stops) { StopBean stop = _stopService.getStopForId(stopId); routes.addAll(stop.getRoutes()); } List<RouteBean> routeBeans = new ArrayList<RouteBean>(routes); boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(routeBeans, query.getMaxCount()); return constructResult(routeBeans, limitExceeded); }
/**** * Private Methods ****/ private RoutesBean getRoutesWithoutRouteNameQuery(SearchQueryBean query) { CoordinateBounds bounds = query.getBounds(); List<AgencyAndId> stops = _whereGeospatialService.getStopsByBounds(bounds); Set<RouteBean> routes = new HashSet<RouteBean>(); for (AgencyAndId stopId : stops) { StopBean stop = _stopService.getStopForId(stopId); routes.addAll(stop.getRoutes()); } List<RouteBean> routeBeans = new ArrayList<RouteBean>(routes); boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(routeBeans, query.getMaxCount()); return constructResult(routeBeans, limitExceeded); }
private StopsBean getStopsByBounds(SearchQueryBean queryBean) throws ServiceException { CoordinateBounds bounds = queryBean.getBounds(); List<AgencyAndId> stopIds = _geospatialBeanService.getStopsByBounds(bounds); boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(stopIds, queryBean.getMaxCount()); List<StopBean> stopBeans = new ArrayList<StopBean>(); for (AgencyAndId stopId : stopIds) { StopBean stopBean = _stopBeanService.getStopForId(stopId); if (stopBean == null) throw new ServiceException(); /** * If the stop doesn't have any routes actively serving it, don't include * it in the results */ if (stopBean.getRoutes().isEmpty()) continue; stopBeans.add(stopBean); } return constructResult(stopBeans, limitExceeded); }
private StopsBean getStopsByBounds(SearchQueryBean queryBean) throws ServiceException { CoordinateBounds bounds = queryBean.getBounds(); List<AgencyAndId> stopIds = _geospatialBeanService.getStopsByBounds(bounds); boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(stopIds, queryBean.getMaxCount()); List<StopBean> stopBeans = new ArrayList<StopBean>(); for (AgencyAndId stopId : stopIds) { StopBean stopBean = _stopBeanService.getStopForId(stopId); if (stopBean == null) throw new ServiceException(); /** * If the stop doesn't have any routes actively serving it, don't include * it in the results */ if (stopBean.getRoutes().isEmpty()) continue; stopBeans.add(stopBean); } return constructResult(stopBeans, limitExceeded); }
boolean useStop = false; List<RouteBean> routes = stopBean.getRoutes(); for (RouteBean routeBean : routes) { String idNoAgency = idParser.parseIdWithoutAgency(routeBean.getId());
for (RouteBean route : stopBean.getRoutes()) {
List<RouteBean> routes = stopBean.getRoutes();
List<RouteBean> routes = stopBean.getRoutes(); for (RouteBean route : routes) { StopsForRouteBean stopsForRoute = transitDataService.getStopsForRoute(route.getId());
public StopV2Bean getStop(StopBean stop) { StopV2Bean bean = new StopV2Bean(); bean.setCode(stop.getCode()); bean.setDirection(stop.getDirection()); bean.setId(stop.getId()); bean.setLat(stop.getLat()); bean.setLon(stop.getLon()); bean.setLocationType(stop.getLocationType()); bean.setName(stop.getName()); bean.setWheelchairBoarding(stop.getWheelchairBoarding()); List<String> routeIds = new ArrayList<String>(); for (RouteBean route : stop.getRoutes()) { routeIds.add(route.getId()); addToReferences(route); } bean.setRouteIds(routeIds); return bean; }
public StopV2Bean getStop(StopBean stop) { StopV2Bean bean = new StopV2Bean(); bean.setCode(stop.getCode()); bean.setDirection(stop.getDirection()); bean.setId(stop.getId()); bean.setLat(stop.getLat()); bean.setLon(stop.getLon()); bean.setLocationType(stop.getLocationType()); bean.setName(stop.getName()); bean.setWheelchairBoarding(stop.getWheelchairBoarding()); List<String> routeIds = new ArrayList<String>(); for (RouteBean route : stop.getRoutes()) { routeIds.add(route.getId()); addToReferences(route); } bean.setRouteIds(routeIds); return bean; }