routingalternatives: consider transit options

This commit is contained in:
2026-01-08 00:32:50 +01:00
parent ca41233397
commit 41bda73041
7 changed files with 144 additions and 11 deletions
@@ -44,10 +44,12 @@ public class RouteDTO {
private List<StepDTO> steps;
@Schema(description = "Amount of CO2e savings in gramm compared to a car trip for the same route.")
private double co2Savings;
@Schema(description = "CO2e emission of this route.")
private double co2Emissions;
@Schema(description = "The temporal difference in minutes compared to the original route the user requested alternatives for.")
private double timeDifferenceSeconds;
public RouteDTO(AddressDTO startAddress, @Nullable String firstStopName, double startLat, double startLon, AddressDTO endAddress, @Nullable String lastStopName, double endLat, double endLon, Instant startDateTime, Instant endDateTime, List<StepDTO> steps, double co2Savings, double timeDifferenceSeconds) {
public RouteDTO(AddressDTO startAddress, @Nullable String firstStopName, double startLat, double startLon, AddressDTO endAddress, @Nullable String lastStopName, double endLat, double endLon, Instant startDateTime, Instant endDateTime, List<StepDTO> steps, double co2Savings, double timeDifferenceSeconds, double co2Emissions) {
this.startAddress = startAddress;
this.firstStopName = firstStopName;
this.startLat = startLat;
@@ -60,6 +62,7 @@ public class RouteDTO {
this.endDateTime = endDateTime;
this.steps = steps;
this.co2Savings = co2Savings;
this.co2Emissions = co2Emissions;
this.timeDifferenceSeconds = timeDifferenceSeconds;
}
@@ -106,7 +109,8 @@ public class RouteDTO {
Instant.now(),
new ArrayList<StepDTO>(),
120.5f,
+16.3f
+16.3f,
20
);
dto.steps.add(new StepDTO(
Modality.WALKING,