diff --git a/matsim/src/main/java/org/matsim/pt/utils/CreatePseudoNetwork.java b/matsim/src/main/java/org/matsim/pt/utils/CreatePseudoNetwork.java index 906c97396ee..104860e67bb 100644 --- a/matsim/src/main/java/org/matsim/pt/utils/CreatePseudoNetwork.java +++ b/matsim/src/main/java/org/matsim/pt/utils/CreatePseudoNetwork.java @@ -152,7 +152,14 @@ private Link getNetworkLink(final TransitRouteStop fromStop, final TransitRouteS } Id newId = Id.create(toFacility.getId().toString() + "." + Integer.toString(copies.size() + 1), TransitStopFacility.class); TransitStopFacility newFacility = this.schedule.getFactory().createTransitStopFacility(newId, toFacility.getCoord(), toFacility.getIsBlockingLane()); - newFacility.setStopAreaId(Id.create(toFacility.getId(), TransitStopArea.class)); + Id transitStopAreaId; + if (toFacility.getStopAreaId() == null) { + transitStopAreaId = Id.create(toFacility.getId(), TransitStopArea.class); + toFacility.setStopAreaId(transitStopAreaId); + } else { + transitStopAreaId = toFacility.getStopAreaId(); + } + newFacility.setStopAreaId(transitStopAreaId); newFacility.setLinkId(link.getId()); newFacility.setName(toFacility.getName()); copies.add(newFacility);