πŸ—ΊοΈ Route Weather Planner β€” Feature Plan

New module for the Weather Analytics Toolkit β€’ Planned Aug 2026

1. Concept

Core idea: Given a route (A β†’ B) and a departure time, calculate what weather the driver will encounter at each point along the way, accounting for travel time.

The weather "moves with you" β€” you don't just get the weather at the destination, you get a timeline of conditions as you drive through them.

Example

TimeLocationTempRainWindConditions
16:30πŸ“ Budapest (start)32Β°C0 mm12 km/hβ˜€οΈ Clear, hot
17:15πŸ“ Hatvan30Β°C0 mm15 km/hβ›… Partly cloudy
18:00πŸ“ FΓΌzesabony28Β°C2.1 mm25 km/h🌧️ Light rain
18:45πŸ“ Miskolc (arrive)26Β°C4.3 mm35 km/h🌧️ Rain, gusty

2. Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ User Input β”‚ β”‚ Route Engine β”‚ β”‚ Weather Engine β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Google Maps │────▢│ β€’ Decode route │────▢│ β€’ For each waypoint β”‚ β”‚ link / coordsβ”‚ β”‚ β€’ Get total time β”‚ β”‚ fetch forecast at β”‚ β”‚ β€’ Departure β”‚ β”‚ β€’ Sample waypoints β”‚ β”‚ arrival time β”‚ β”‚ β€’ Precision β”‚ β”‚ based on precisionβ”‚ β”‚ β€’ Open-Meteo API β”‚ β”‚ β€’ Stops β”‚ β”‚ β€’ Add stop delays β”‚ β”‚ β€’ Return conditions β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ HTML Report β”‚ β”‚ β”‚ β”‚ β€’ Route timeline β”‚ β”‚ β€’ Weather cards β”‚ β”‚ β€’ Alerts/warnings β”‚ β”‚ β€’ Map overview β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. Input Specification

Required

ParameterFormatExample
RouteGoogle Maps URL or list of city nameshttps://maps.google.com/.../@47.5,19.0 or "Budapest, Hatvan, Miskolc"
Departure timeISO datetime or relative2026-08-08T16:30 or "now" or "+2h"
Precisionlow / medium / high--precision medium

Optional

ParameterFormatExample
Stopslocation + duration--stop "Hatvan:60min"
Speed overridekm/h average--speed 100 (default: use route estimate)
Output formathtml / json / email--format html

Precision Levels

LevelWaypoint FrequencyExample (Budapest→Miskolc, 180km)
lowStart + End only2 points
mediumEvery ~30-40 min of driving4-5 points
highEvery ~15-20 min of driving8-10 points

4. Technical Design

4.1 Route Decoding

Option A β€” Google Maps Directions API (requires API key, paid after quota)

Option B β€” OSRM (Open Source Routing Machine) β€” free, self-hosted or public demo server

Option C β€” Manual waypoints β€” user provides city list, we geocode and estimate times

Recommended: Option B (OSRM) with fallback to Option C.

4.2 Waypoint Sampling

def sample_waypoints(route_geometry, precision, stops):
    """
    Given a route polyline and precision level,
    return a list of (lat, lon, estimated_arrival_time) tuples.
    """
    total_duration = route.duration  # seconds
    
    intervals = {
        "low": [0, total_duration],          # start + end
        "medium": range(0, total_duration, 1800),  # every 30 min
        "high": range(0, total_duration, 900),     # every 15 min
    }
    
    for elapsed in intervals[precision]:
        point = interpolate_along_route(geometry, elapsed / total_duration)
        arrival = departure_time + timedelta(seconds=elapsed) + stop_delay(elapsed, stops)
        waypoints.append((point.lat, point.lon, arrival, nearest_city(point)))
    
    return waypoints

4.3 Weather Fetching

def get_route_weather(waypoints):
    """Fetch forecast for each waypoint at its specific arrival time."""
    results = []
    for lat, lon, arrival_time, city_name in waypoints:
        # Open-Meteo hourly forecast β€” free, no key needed
        forecast = fetch_open_meteo(
            lat=lat, lon=lon,
            start=arrival_time.replace(minute=0),
            end=arrival_time.replace(minute=0) + timedelta(hours=1),
            params=["temperature_2m", "precipitation", "cloud_cover",
                    "wind_speed_10m", "wind_gusts_10m", "weather_code"]
        )
        results.append({
            "city": city_name,
            "lat": lat, "lon": lon,
            "arrival": arrival_time,
            "weather": interpolate_to_exact_time(forecast, arrival_time)
        })
    return results

4.4 Reverse Geocoding (waypoint β†’ city name)

4.5 Stop Handling

When the user declares a stop (e.g., --stop "Hatvan:60min"):

  1. Find the waypoint closest to Hatvan
  2. Add 60 minutes to all subsequent arrival times
  3. Optionally: show "weather during stop" (what conditions while waiting)

5. Output β€” HTML Report

Template features

Mockup

πŸ—ΊοΈ Route Weather: Budapest β†’ Miskolc

Departure: Sat Aug 8, 16:30 β€’ Distance: 181 km β€’ Duration: 2h 15min β€’ Precision: medium


⏱️ TimeπŸ“ LocationπŸŒ‘οΈπŸŒ§οΈπŸ’¨Conditions
16:30Budapest (start)32Β°Cβ€”12 km/hβ˜€οΈ Clear
17:15Hatvan30Β°Cβ€”15 km/hβ›… Partly cloudy
17:15–18:15β˜• Stop: Hatvan (1h)β›… Warm, dry during stop
19:00Füzesabony28°C2.1 mm25 km/h🌦️ Light showers
19:45Miskolc (arrive)26°C4.3 mm35 km/h🌧️ Rain + wind ⚠️

⚠️ Rain expected in the Miskolc area from 19:00. Consider earlier departure or rain gear.

6. CLI Interface

# Basic usage
./scripts/route-weather/route-weather.py \
    --from "Budapest" --to "Miskolc" \
    --depart "2026-08-08T16:30" \
    --precision medium

# With Google Maps link
./scripts/route-weather/route-weather.py \
    --url "https://www.google.com/maps/dir/Budapest/Miskolc" \
    --depart now \
    --precision high

# With stops
./scripts/route-weather/route-weather.py \
    --from "Budapest" --to "Miskolc" \
    --depart "+1h" \
    --precision medium \
    --stop "Hatvan:60min" \
    --stop "FΓΌzesabony:15min"

# Output options
    --format html          # default: generates HTML report
    --format json          # machine-readable
    --dry-run              # show plan without fetching weather
    --output route-weather.html

7. File Structure

scripts/route-weather/
β”œβ”€β”€ route-weather.py       # Main script
β”œβ”€β”€ template.html          # HTML report template
β”œβ”€β”€ route_engine.py        # OSRM routing + waypoint sampling
β”œβ”€β”€ geocoder.py            # Reverse geocoding (coords β†’ city name)
└── README.md

shared/
β”œβ”€β”€ config.py              # Add route-weather defaults
└── i18n.js                # Reuse existing translations (add route keys)

8. Dependencies

ServicePurposeCostRate Limit
OSRM (public demo)Route calculationFreeFair use
Open-MeteoWeather forecastFree10,000/day
Nominatim (OSM)Reverse geocodingFree1 req/sec

No API keys needed. All services are free and open. Existing requests library is sufficient β€” no new Python deps.

9. Implementation Phases

Phase 1 Core MVP (1-2 sessions)

Phase 2 Polish (1 session)

Phase 3 Enhanced (optional)

10. Risks & Mitigations

RiskImpactMitigation
OSRM public demo goes downNo route calculationFallback: straight-line interpolation with estimated speed
Nominatim rate limit (1/sec)Slow for high-precision routesBatch + cache; use Hungarian settlement DB offline
Open-Meteo only hourly resolutionArrival at :35 gets :00 dataLinear interpolation between hours
Google Maps URL format changesParsing breaksKeep manual --from/--to as primary; URL is convenience

11. What I Need to Start

  1. Confirmation on approach β€” OSRM (free) vs Google Maps API (paid, more accurate traffic estimates)?
  2. Default speed assumption β€” if OSRM doesn't account for traffic, assume highway avg? (e.g., 110 km/h highway, 50 km/h city)
  3. Integration β€” standalone script only, or also add to the daily cron (e.g., a "saved routes" feature)?
  4. Go ahead to start Phase 1?