route_condition_forecast library

Per-segment weather and hazard forecasting along a planned route.

Projects driving_weather conditions and fleet_hazard zones onto route segments with time-of-arrival weighting. Pure Dart, no Flutter.

Quick start:

final forecaster = RouteConditionForecaster(
  forecastProvider: CurrentConditionsForecastProvider(currentWeather),
  hazardZones: myHazardZones,
);
final forecast = await forecaster.forecast(routeResult);
if (forecast.hasAnyHazard) {
  print('Hazard at ${forecast.firstHazardEtaSeconds}s');
}

Classes

CurrentConditionsForecastProvider
Simplest ForecastProvider: returns the same WeatherCondition for every position and ETA.
ForecastProvider
Provides a weather forecast for a given position and future time horizon.
RouteConditionForecaster
Projects weather and fleet hazard conditions onto the segments of a route.
RouteForecast
Complete condition forecast for all segments along a route.
RouteSegment
A portion of a route between two waypoints.
RouteSegmenter
Splits a RouteResult into RouteSegment objects.
SegmentConditionForecast
Forecasted driving conditions for a single route segment.