implement full logic to filter ad hoc route suggestions against weather conditions
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good

This commit is contained in:
2026-01-11 14:00:44 +01:00
parent 4d112a599f
commit 1b74f6125c
10 changed files with 179 additions and 62 deletions
@@ -20,18 +20,20 @@ public class MeteoClient {
* Simple wrapper around meteo's forecast API.
* https://open-meteo.com/en/docs
*/
public Mono<ForecastResponse> getForecastWeatherCodeToday(
public Mono<ForecastResponse> getForecastWeatherCodeTodayYesterday(
double lat,
double lon
) {
String today = LocalDate.now().toString(); // Uses ISO-8601 format: yyyy-MM-dd
// We include yesterday for cases where routes cross midnight
String yesterday = LocalDate.now().minusDays(1).toString();
return meteoClient.get()
.uri(uriBuilder -> uriBuilder.path("/forecast")
.queryParam("latitude", lat)
.queryParam("longitude", lon)
.queryParam("hourly", "weather_code")
.queryParam("start_date", today)
.queryParam("start_date", yesterday)
.queryParam("end_date", today)
.build())
.retrieve()