diff --git a/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java b/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java index 578e59034c3..ce26a6ac417 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java @@ -106,7 +106,7 @@ public Itinerary createItinerary(RaptorPath path) { legs.add(transitLeg); } // Map transfer leg - else if (pathLeg.isTransferLeg()) { + else if (pathLeg.isTransferLeg() && !staySeatedInTransferFrom(transitLeg)) { legs.addAll( mapTransferLeg( pathLeg.asTransferLeg(), @@ -321,4 +321,12 @@ private Place mapPlace(GenericLocation location) { private ZonedDateTime createZonedDateTime(int timeInSeconds) { return transitSearchTimeZero.plusSeconds(timeInSeconds); } + + private boolean staySeatedInTransferFrom(Leg transitLeg) { + return ( + transitLeg != null && + transitLeg.getTransferToNextLeg() != null && + transitLeg.getTransferToNextLeg().getTransferConstraint().isStaySeated() + ); + } }