implement full logic to filter ad hoc route suggestions against weather conditions
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user