use of org.rutebanken.netex.model.LinkInLinkSequence_VersionedChildStructure in project OpenTripPlanner by opentripplanner.
the class ServiceLinkMapper method getShapePointsByJourneyPattern.
public Collection<ShapePoint> getShapePointsByJourneyPattern(JourneyPattern journeyPattern, ReadOnlyHierarchicalMapById<ServiceLink> serviceLinkById, ReadOnlyHierarchicalMap<String, String> quayIdByStopPointRef, ReadOnlyHierarchicalVersionMapById<Quay> quayById) {
Collection<ShapePoint> shapePoints = new ArrayList<>();
if (journeyPattern.getLinksInSequence() != null) {
MutableInt sequenceCounter = new MutableInt(0);
MutableDouble distance = new MutableDouble(0);
for (LinkInLinkSequence_VersionedChildStructure linkInLinkSequence_versionedChildStructure : journeyPattern.getLinksInSequence().getServiceLinkInJourneyPatternOrTimingLinkInJourneyPattern()) {
String serviceLinkRef = ((ServiceLinkInJourneyPattern_VersionedChildStructure) linkInLinkSequence_versionedChildStructure).getServiceLinkRef().getRef();
shapePoints.addAll(mapServiceLink(serviceLinkById.lookup(serviceLinkRef), journeyPattern, sequenceCounter, distance, quayIdByStopPointRef, quayById));
}
}
return shapePoints;
}
Aggregations