use of org.rutebanken.netex.model.DestinationDisplay in project OpenTripPlanner by opentripplanner.
the class StopTimesMapper method mapToStopTime.
private StopTime mapToStopTime(Trip trip, StopPointInJourneyPattern stopPoint, Stop stop, TimetabledPassingTime passingTime, int stopSequence) {
StopTime stopTime = new StopTime();
stopTime.setTrip(trip);
stopTime.setStopSequence(stopSequence);
stopTime.setStop(stop);
stopTime.setArrivalTime(calculateOtpTime(passingTime.getArrivalTime(), passingTime.getArrivalDayOffset(), passingTime.getDepartureTime(), passingTime.getDepartureDayOffset()));
stopTime.setDepartureTime(calculateOtpTime(passingTime.getDepartureTime(), passingTime.getDepartureDayOffset(), passingTime.getArrivalTime(), passingTime.getArrivalDayOffset()));
if (stopPoint != null) {
if (isFalse(stopPoint.isForAlighting())) {
stopTime.setDropOffType(PICKDROP_NONE);
} else if (Boolean.TRUE.equals(stopPoint.isRequestStop())) {
stopTime.setDropOffType(PICKDROP_COORDINATE_WITH_DRIVER);
} else {
stopTime.setDropOffType(PICKDROP_SCHEDULED);
}
if (isFalse(stopPoint.isForBoarding())) {
stopTime.setPickupType(PICKDROP_NONE);
} else if (Boolean.TRUE.equals(stopPoint.isRequestStop())) {
stopTime.setPickupType(PICKDROP_COORDINATE_WITH_DRIVER);
} else {
stopTime.setPickupType(PICKDROP_SCHEDULED);
}
if (stopPoint.getDestinationDisplayRef() != null) {
DestinationDisplay destinationDisplay = destinationDisplayById.lookup(stopPoint.getDestinationDisplayRef().getRef());
if (destinationDisplay != null) {
currentHeadSign = destinationDisplay.getFrontText().getValue();
}
}
}
if (passingTime.getArrivalTime() == null && passingTime.getDepartureTime() == null) {
LOG.warn("Time missing for trip " + trip.getId());
}
if (currentHeadSign != null) {
stopTime.setStopHeadsign(currentHeadSign);
}
return stopTime;
}
use of org.rutebanken.netex.model.DestinationDisplay in project OpenTripPlanner by opentripplanner.
the class NetexImportDataIndex method readOnlyView.
public NetexImportDataIndexReadOnlyView readOnlyView() {
return new NetexImportDataIndexReadOnlyView() {
/**
* Lookup a Network given a GroupOfLine id or an Network id. If the given
* {@code groupOfLineOrNetworkId} is a GroupOfLine ID, we lookup the GroupOfLine, and then
* lookup its Network. If the given {@code groupOfLineOrNetworkId} is a Network ID then we
* can lookup the Network directly.
* <p/>
* If no Network is found {@code null} is returned.
*/
public Network lookupNetworkForLine(String groupOfLineOrNetworkId) {
GroupOfLines groupOfLines = groupOfLinesById.lookup(groupOfLineOrNetworkId);
String networkId = groupOfLines == null ? groupOfLineOrNetworkId : networkIdByGroupOfLineId.lookup(groupOfLines.getId());
return networkById.lookup(networkId);
}
public ReadOnlyHierarchicalMapById<Authority> getAuthoritiesById() {
return authoritiesById;
}
public ReadOnlyHierarchicalMapById<DayType> getDayTypeById() {
return dayTypeById;
}
public ReadOnlyHierarchicalMap<String, Collection<DayTypeAssignment>> getDayTypeAssignmentByDayTypeId() {
return dayTypeAssignmentByDayTypeId;
}
public Iterable<DayTypeRefsToServiceIdAdapter> getDayTypeRefs() {
return Collections.unmodifiableSet(dayTypeRefs);
}
public ReadOnlyHierarchicalMapById<DestinationDisplay> getDestinationDisplayById() {
return destinationDisplayById;
}
public ReadOnlyHierarchicalMapById<GroupOfStopPlaces> getGroupOfStopPlacesById() {
return groupOfStopPlacesById;
}
public ReadOnlyHierarchicalMapById<JourneyPattern> getJourneyPatternsById() {
return journeyPatternsById;
}
public ReadOnlyHierarchicalMapById<Line> getLineById() {
return lineById;
}
public ReadOnlyHierarchicalMapById<StopPlace> getMultiModalStopPlaceById() {
return multiModalStopPlaceById;
}
public ReadOnlyHierarchicalMapById<Notice> getNoticeById() {
return noticeById;
}
public ReadOnlyHierarchicalMapById<NoticeAssignment> getNoticeAssignmentById() {
return noticeAssignmentById;
}
public ReadOnlyHierarchicalMapById<OperatingPeriod> getOperatingPeriodById() {
return operatingPeriodById;
}
public ReadOnlyHierarchicalMapById<Operator> getOperatorsById() {
return operatorsById;
}
public ReadOnlyHierarchicalMap<String, Collection<TimetabledPassingTime>> getPassingTimeByStopPointId() {
return passingTimeByStopPointId;
}
public ReadOnlyHierarchicalVersionMapById<Quay> getQuayById() {
return quayById;
}
public ReadOnlyHierarchicalMap<String, String> getQuayIdByStopPointRef() {
return quayIdByStopPointRef;
}
public ReadOnlyHierarchicalMapById<Route> getRouteById() {
return routeById;
}
public ReadOnlyHierarchicalMap<String, Collection<ServiceJourney>> getServiceJourneyByPatternId() {
return serviceJourneyByPatternId;
}
public ReadOnlyHierarchicalMapById<ServiceLink> getServiceLinkById() {
return serviceLinkById;
}
public ReadOnlyHierarchicalVersionMapById<StopPlace> getStopPlaceById() {
return stopPlaceById;
}
public ReadOnlyHierarchicalMapById<TariffZone> getTariffZonesById() {
return tariffZonesById;
}
public String getTimeZone() {
return timeZone.get();
}
};
}
Aggregations