Search in sources :

Example 11 with ShapePoint

use of org.opentripplanner.model.ShapePoint 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

ShapePoint (org.opentripplanner.model.ShapePoint)11 ArrayList (java.util.ArrayList)3 MutableDouble (org.apache.commons.lang3.mutable.MutableDouble)2 Test (org.junit.Test)2 Coordinate (org.locationtech.jts.geom.Coordinate)2 FeedScopedId (org.opentripplanner.model.FeedScopedId)2 Quay (org.rutebanken.netex.model.Quay)2 MutableInt (org.apache.commons.lang3.mutable.MutableInt)1 CoordinateSequence (org.locationtech.jts.geom.CoordinateSequence)1 LineString (org.locationtech.jts.geom.LineString)1 PackedCoordinateSequence (org.opentripplanner.common.geometry.PackedCoordinateSequence)1 DataImportIssueStore (org.opentripplanner.graph_builder.DataImportIssueStore)1 MissingProjectionInServiceLink (org.opentripplanner.graph_builder.issues.MissingProjectionInServiceLink)1 OtpTransitServiceBuilder (org.opentripplanner.model.impl.OtpTransitServiceBuilder)1 HierarchicalMap (org.opentripplanner.netex.loader.util.HierarchicalMap)1 HierarchicalMapById (org.opentripplanner.netex.loader.util.HierarchicalMapById)1 HierarchicalVersionMapById (org.opentripplanner.netex.loader.util.HierarchicalVersionMapById)1 JourneyPattern (org.rutebanken.netex.model.JourneyPattern)1 LinkInLinkSequence_VersionedChildStructure (org.rutebanken.netex.model.LinkInLinkSequence_VersionedChildStructure)1 LinkSequenceProjection_VersionStructure (org.rutebanken.netex.model.LinkSequenceProjection_VersionStructure)1