From fd8a447e051ba8cc89666e2c36944ceb1ce2a359 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried <mail@leonard.io> Date: Mon, 20 Nov 2023 15:23:41 +0100 Subject: [PATCH] Add accessibilityScore --- src/main/java/org/opentripplanner/client/model/Itinerary.java | 3 ++- src/main/java/org/opentripplanner/client/model/Leg.java | 4 +++- src/main/resources/queries/plan.graphql | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opentripplanner/client/model/Itinerary.java b/src/main/java/org/opentripplanner/client/model/Itinerary.java index 54cc0a7..e7ccf8b 100644 --- a/src/main/java/org/opentripplanner/client/model/Itinerary.java +++ b/src/main/java/org/opentripplanner/client/model/Itinerary.java @@ -1,8 +1,9 @@ package org.opentripplanner.client.model; import java.util.List; +import java.util.OptionalDouble; -public record Itinerary(List<Leg> legs) { +public record Itinerary(List<Leg> legs, OptionalDouble accessibilityScore) { /** Does this itinerary contain any legs that contain public transport? */ public boolean hasTransit() { diff --git a/src/main/java/org/opentripplanner/client/model/Leg.java b/src/main/java/org/opentripplanner/client/model/Leg.java index 12e03d7..798196f 100644 --- a/src/main/java/org/opentripplanner/client/model/Leg.java +++ b/src/main/java/org/opentripplanner/client/model/Leg.java @@ -3,6 +3,7 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; +import java.util.OptionalDouble; import org.opentripplanner.client.model.TripPlan.Place; public record Leg( @@ -14,7 +15,8 @@ public record Leg( Duration duration, double distance, Route route, - List<FareProductUse> fareProducts) { + List<FareProductUse> fareProducts, + OptionalDouble accessibilityScore) { /** Is this leg using public transport? */ public boolean isTransit() { diff --git a/src/main/resources/queries/plan.graphql b/src/main/resources/queries/plan.graphql index 4da6ced..17e5664 100644 --- a/src/main/resources/queries/plan.graphql +++ b/src/main/resources/queries/plan.graphql @@ -13,6 +13,7 @@ query { itineraries { startTime endTime + accessibilityScore legs { startTime endTime @@ -61,6 +62,7 @@ query { } } } + accessibilityScore } } }