use of org.opentripplanner.model.GroupOfStations in project OpenTripPlanner by opentripplanner.
the class GroupOfStationsMapper method map.
GroupOfStations map(GroupOfStopPlaces groupOfStopPlaces) {
GroupOfStations groupOfStations = new GroupOfStations();
groupOfStations.setId(idFactory.createId(groupOfStopPlaces.getId()));
groupOfStations.setName(groupOfStopPlaces.getName().getValue());
WgsCoordinate coordinate = WgsCoordinateMapper.mapToDomain(groupOfStopPlaces.getCentroid());
if (coordinate == null) {
// TODO OTP2 - This should be an data import issue
LOG.warn("MultiModal station {} does not contain any coordinates.", groupOfStations.getId());
} else {
groupOfStations.setCoordinate(coordinate);
}
connectChildStation(groupOfStopPlaces, groupOfStations);
return groupOfStations;
}
use of org.opentripplanner.model.GroupOfStations in project OpenTripPlanner by opentripplanner.
the class Graph method getStopsForId.
private Collection<Stop> getStopsForId(FeedScopedId id) {
// GroupOfStations
GroupOfStations groupOfStations = groupOfStationsById.get(id);
if (groupOfStations != null) {
return groupOfStations.getChildStops();
}
// Multimodal station
MultiModalStation multiModalStation = multiModalStationById.get(id);
if (multiModalStation != null) {
return multiModalStation.getChildStops();
}
// Station
Station station = stationById.get(id);
if (station != null) {
return station.getChildStops();
}
// Single stop
Stop stop = index.getStopForId(id);
if (stop != null) {
return Collections.singleton(stop);
}
return null;
}
Aggregations