alternative filter: fix bug - physical activity thresholds only for phyiscal acitivies

This commit is contained in:
2026-01-10 18:04:21 +01:00
parent a643db3133
commit 4d112a599f
@@ -40,7 +40,7 @@ public class AlternativeFilterService {
for (RouteDTO routeDTO : alternatives) {
long travelTimeDeltaSeconds = routeDTO.getDurationSeconds() - originalTravelTimeSeconds;
if (alternativeRequestDTO.getRoutingPreferencesDTO().isPreferPhysicalActivity()) {
if (routeDTO.isPhysicalActivity() && alternativeRequestDTO.getRoutingPreferencesDTO().isPreferPhysicalActivity()) {
if (travelTimeDeltaSeconds < routingProperties.getMinimumAcceptedAdditionalSecondsPrefersPhysicalActivity()
|| (long) travelTimeDeltaSeconds < toleratedMaximumPhysical) {
filteredAlternatives.add(routeDTO);
@@ -56,5 +56,17 @@ public class AlternativeFilterService {
return filteredAlternatives;
}
/**
* If weather conditions at point of travel are considered not acceptable for "outdoor" modalities such as
* walking and biking, the routes are removed. This does not affect transit routes which necessarily have to contain
* some walking elements.
*/
public List<RouteDTO> filterForBadWeather(RoutingAlternativeRequestDTO requestDTO, List<RouteDTO> alternatives
) {
// TODO implement call to meteo
return alternatives;
}
}