All projects
Live

NZ Adventure Planner

Real-time safety scoring for New Zealand's backcountry — weather + earthquakes combined

Built in 4 days
Next.jsTypeScriptMapbox GL JSOpen-MeteoGeoNet API

Real-time seismic + weather fusion

Haversine proximity matching

60+ DOC tracks scored

Hourly forecast updates

01The Problem

New Zealand's backcountry is genuinely hazardous: alpine weather changes fast, DOC tracks vary from easy walks to technical alpine routes, and the country sits on the Pacific Ring of Fire — earthquakes are common. Planning a hike requires checking weather forecasts AND seismic activity, then synthesizing that into a go/no-go decision. No existing tool combined these signals.

02The Approach

Built a multi-source data pipeline that pulls from Open-Meteo for hourly weather forecasts and GeoNet (NZ's geological hazard agency) for real-time seismic events. Each track gets a composite adventure score (0–10) computed from six factors: precipitation, wind, visibility, temperature, recent earthquake magnitude within 100km, and a ground stability bonus. The Mapbox GL JS map shows all tracks color-coded by score in real-time.

03Architecture Decisions

GeoNet WebSocket for live seismic data

GeoNet's public API provides near-real-time earthquake data. The app fetches recent events (last 48 hours), filters by proximity to each track coordinate using the Haversine formula, and incorporates the nearest significant event's magnitude into the safety score. Events above M4.5 within 50km trigger a warning flag.

Coordinate-matched weather lookups

Each DOC track has a lat/lng centroid. The app queries Open-Meteo's point forecast API for each track's exact location, fetching hourly precipitation, wind speed/direction, cloud cover, and visibility. This gives accurate mountain-specific forecasts rather than the nearest city's weather.

Composite scoring with override logic

The score is a weighted average of all factors, but certain conditions trigger hard overrides: sustained winds >60km/h cap the score at 4, recent M5+ earthquake within 25km caps at 3. This prevents a great weather day from masking a genuinely dangerous condition.

Mapbox GL JS with cluster markers

The interactive map uses Mapbox GL JS with custom color-coded markers (green = great, amber = caution, red = avoid). At low zoom, markers cluster. At high zoom, each track shows its name and score. Clicking a marker expands a detail card with the full condition breakdown.

04Key Insight

The GeoNet API returns global seismic events, so a naive distance filter would flag NZ tracks for earthquakes in Chile. Filtering by the NZ bounding box first, then sorting by recency, then checking proximity keeps the alert logic relevant without false positives from distant events.

05Why It Matters

A practical tool for outdoor enthusiasts in NZ. Shows multi-source data integration, real-time APIs, and geospatial reasoning — skills that transfer to any platform combining heterogeneous data sources into actionable recommendations.