Search in sources :

Example 1 with LinkInLinkSequence_VersionedChildStructure

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;
}
Also used : ShapePoint(org.opentripplanner.model.ShapePoint) LinkInLinkSequence_VersionedChildStructure(org.rutebanken.netex.model.LinkInLinkSequence_VersionedChildStructure) MutableDouble(org.apache.commons.lang3.mutable.MutableDouble) MutableInt(org.apache.commons.lang3.mutable.MutableInt) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 MutableDouble (org.apache.commons.lang3.mutable.MutableDouble)1 MutableInt (org.apache.commons.lang3.mutable.MutableInt)1 ShapePoint (org.opentripplanner.model.ShapePoint)1 LinkInLinkSequence_VersionedChildStructure (org.rutebanken.netex.model.LinkInLinkSequence_VersionedChildStructure)1