private Stop doMap(org.onebusaway.gtfs.model.Stop rhs) { Stop lhs = new Stop(); lhs.setId(mapAgencyAndId(rhs.getId())); lhs.setName(rhs.getName()); lhs.setLat(rhs.getLat()); lhs.setLon(rhs.getLon()); lhs.setCode(rhs.getCode()); lhs.setDesc(rhs.getDesc()); lhs.setZoneId(rhs.getZoneId()); lhs.setUrl(rhs.getUrl()); lhs.setLocationType(rhs.getLocationType()); lhs.setParentStation(rhs.getParentStation()); lhs.setWheelchairBoarding(rhs.getWheelchairBoarding()); lhs.setDirection(rhs.getDirection()); lhs.setTimezone(rhs.getTimezone()); lhs.setVehicleType(rhs.getVehicleType()); lhs.setPlatformCode(rhs.getPlatformCode()); return lhs; } }
public TransitStop(String id, double lon, double lat, String name, String stopId, Stop stop) { super(id, lon, lat, name, stopId); if (stop != null) { this.wheelchairEntrance = stop.getWheelchairBoarding() == 1; } isEntrance = stop == null ? false : stop.getLocationType() == 2; }
private Map<String, Stop> getStopMap(GtfsDao dao) { Map<String, Stop> map = new HashMap<>(); for (Stop stop : dao.getAllStops()) { if (stop.getLocationType() == 0) { map.put(stop.getId().getId(), stop); } } return map; }
@Override public List<Stop> getStopsForStation(Stop station) { if (_stopsByStation == null) { _stopsByStation = new HashMap<Stop, List<Stop>>(); for (Stop stop : getAllStops()) { if (stop.getLocationType() == 0 && stop.getParentStation() != null) { Stop parentStation = getStopForId(new AgencyAndId( stop.getId().getAgencyId(), stop.getParentStation())); List<Stop> subStops = _stopsByStation.get(parentStation); if (subStops == null) { subStops = new ArrayList<Stop>(2); _stopsByStation.put(parentStation, subStops); } subStops.add(stop); } } } return list(_stopsByStation.get(station)); }
@Override public List<Stop> getStopsForStation(Stop station) { if (_stopsByStation == null) { _stopsByStation = new HashMap<Stop, List<Stop>>(); for (Stop stop : getAllStops()) { if (stop.getLocationType() == 0 && stop.getParentStation() != null) { Stop parentStation = getStopForId(new AgencyAndId( stop.getId().getAgencyId(), stop.getParentStation())); List<Stop> subStops = _stopsByStation.get(parentStation); if (subStops == null) { subStops = new ArrayList<Stop>(2); _stopsByStation.put(parentStation, subStops); } subStops.add(stop); } } } return list(_stopsByStation.get(station)); }
@Override public List<ErrorListHelperModel> validate(GtfsDaoImpl gtfsData) { List<OccurrenceModel> e010List = new ArrayList<>(); Collection<StopTime> stopTimes = gtfsData.getAllStopTimes(); Set<Stop> checkedStops = new HashSet<>(); for (StopTime stopTime : stopTimes) { if (!checkedStops.contains(stopTime.getStop())) { checkedStops.add(stopTime.getStop()); if (stopTime.getStop().getLocationType() != 0) { RuleUtils.addOccurrence(E010, "stop_id " + stopTime.getStop().getId(), e010List, _log); } } } List<ErrorListHelperModel> errors = new ArrayList<>(); if (!e010List.isEmpty()) { errors.add(new ErrorListHelperModel(new MessageLogModel(E010), e010List)); } return errors; } }
if (stopsHaveParents) { String gid = stop.getLocationType() == LOCATION_TYPE_STOP ? stop.getParentStation() : stop.getId().getId(); StopGroup group = stopGroups.get(gid); if (group == null) { stopGroups.put(gid, group); if (stop.getLocationType() == LOCATION_TYPE_STATION) { group.parent = stop; } else if (stop.getId().getId().endsWith("S")) { group.uptown = stop; } else { _log.error("unexpected stop not of parent type but of {} for stop {}", stop.getLocationType(), stop.getId()); continue;
stopToAdd.setLat(referenceStops.get(parentStation).getLat()); stopToAdd.setLon(referenceStops.get(parentStation).getLon()); stopToAdd.setLocationType(referenceStops.get(parentStation).getLocationType()); stopsAdded.add(referenceStops.get(parentStation).getId()); stopsToAdd.add(stopToAdd);
atisStop.setId(refStop.getId()); atisStop.setParentStation(refStop.getParentStation()); atisStop.setLocationType(refStop.getLocationType()); stopsAdded.put(atisStop.getId(), new AgencyAndId(agencyAndId.getAgencyId(), atisId));
mStopToLocationTypeMap.put(stop.getId().getId(), stop.getLocationType());
private StopBean fillStopBean(Stop stop, StopBean bean) { bean.setId(ApplicationBeanLibrary.getId(stop.getId())); bean.setLat(stop.getLat()); bean.setLon(stop.getLon()); StopNarrative stopNarrative = _narrativeService.getStopForId(stop.getId()); if (stopNarrative != null) bean.setDirection(stopNarrative.getDireciton()); bean.setName(stop.getName()); bean.setCode(StringLibrary.getBestName(stop.getCode(), stop.getId().getId())); bean.setLocationType(stop.getLocationType()); return bean; }