use of org.onebusaway.enterprise.webapp.actions.api.model.RouteInRegionResult in project onebusaway-application-modules by camsys.
the class SearchResultFactoryImpl method getRouteResultForRegion.
@Override
public SearchResult getRouteResultForRegion(RouteBean routeBean) {
List<String> polylines = new ArrayList<String>();
StopsForRouteBean stopsForRoute = _transitDataService.getStopsForRoute(routeBean.getId());
List<StopGroupingBean> stopGroupings = stopsForRoute.getStopGroupings();
for (StopGroupingBean stopGroupingBean : stopGroupings) {
for (StopGroupBean stopGroupBean : stopGroupingBean.getStopGroups()) {
NameBean name = stopGroupBean.getName();
String type = name.getType();
if (!type.equals("destination"))
continue;
for (EncodedPolylineBean polyline : stopGroupBean.getPolylines()) {
polylines.add(polyline.getPoints());
}
}
}
return new RouteInRegionResult(routeBean, polylines);
}
Aggregations