diff --git a/src/main/java/org/matsim/run/prepare/PrepareNetwork.java b/src/main/java/org/matsim/run/prepare/PrepareNetwork.java index 2330f4fe..0fa372a5 100644 --- a/src/main/java/org/matsim/run/prepare/PrepareNetwork.java +++ b/src/main/java/org/matsim/run/prepare/PrepareNetwork.java @@ -12,6 +12,7 @@ import org.matsim.application.options.ShpOptions; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.algorithms.MultimodalNetworkCleaner; +import org.matsim.core.network.algorithms.NetworkCleaner; import org.matsim.core.utils.geometry.geotools.MGC; import org.matsim.core.utils.gis.ShapeFileReader; import org.matsim.run.LeipzigUtils; @@ -86,6 +87,12 @@ static void prepareDRT(Network network, ShpOptions shp) { } } + //we have to call the MultiModalNetworkCleaner for each mode individually, because otherwise the individual subnetworks might not get cleaned + MultimodalNetworkCleaner multimodalNetworkCleaner = new MultimodalNetworkCleaner(network); + for (String mode : modeGeoms.keySet()) { + multimodalNetworkCleaner.run(Set.of(mode)); + } + log.log(Level.INFO, "The following modes have been added to the network: {}", modeGeoms.keySet()); }