LankaTwin — Lankan Technical Weather Information Network
Live at lankatwin.github.io
A free, open-source window onto Sri Lanka's weather, rivers, air and land — running entirely in your browser.
LankaTwin stands for Lankan Technical Weather Information Network: TWIN is short for Technical Weather Information Network.
It pulls live, open data (forecast models, satellite imagery, Irrigation Department river gauges and air quality) straight from
the publishers into an interactive map and charts, with no server and no running cost on GitHub Pages.
What it does
- Live map of all 25 district capitals plus Negombo: temperature, feels-like, rain in the last and next 24 h, humidity, gusts, US AQI and PM2.5, colour-coded on the map.
- Official river gauges (
/gauges): live hourly water levels and rainfall from the Irrigation Department's hydrometric stations (the data behind its Realtime Water Level in Major River dashboard): station and alert/minor/major flood counts, basin → station picker, current level with trend, 3-day level chart against the gauge's flood levels, daily rainfall, hourly-update and flood-level lists for the last 4 days, last-hour and 24-hour rainfall rankings, CSV export. Gauges also appear on the main map, raise signals, and feed the live and floods pages; river basins, rivers and mapped flood areas can be shown as map layers.
- Rivers: modelled discharge at 14 points on the Kelani, Kalu, Gin, Nilwala, Walawe, Mahaweli, Deduru, Malwathu and other rivers, with a rise indicator comparing the 10-day forecast peak with the past 30 days.
- Satellite overlays from NASA GIBS: MODIS true colour (any date), 8-day NDVI, IMERG rain rate, land surface temperature.
- Place pages: 24 h / 7 d / 30 d charts for temperature, rain, humidity, wind, air quality and soil moisture; a 7-day forecast; this month's rain against the past decade (ERA5); and solar energy received (NASA POWER).
- Compare up to five places on one chart; signals for heavy rain, heat stress, strong gusts, poor air and rising rivers.
- Search (press
/ or Ctrl K) in English, Sinhala or Tamil; Near me finds your closest town; star places to keep them on top.
- Images: a photo of every town from Wikipedia (credited to its Commons author), real landscape photos from Wikimedia Commons served as small WebP files (
public/photos, built by scripts/photos.py), drawn landscapes when offline, weather icons, and a daily MODIS satellite image of the whole island.
- Forecast detail: next-24-hour strip, 7-day outlook with UV and gusts, the current monsoon season, and the rivers near each town.
- Share and embed: a share menu on every key screen (WhatsApp, Facebook, X, Telegram, Viber, LinkedIn, email, SMS, copy link or copy a ready-made summary; the system share sheet on phones), and a live
<iframe> widget for other sites (/embed/<place>).
- Search-friendly: real URLs, with an HTML file per page (12 sections, 26 towns, 14 river points and every river gauge) carrying its own title, description, canonical link, Open Graph and Twitter tags, share image and schema.org data (WebSite, Organization, WebApplication, Place, Dataset, BreadcrumbList);
sitemap.xml and robots.txt are generated with the build.
- Logo and loading: a mark drawn from Sri Lanka's real coastline (Natural Earth), app icons for every platform, a branded splash while the app loads, and blur-up placeholders for images.
- Safety: emergency numbers (117, 119, 110, 1990) and opt-in browser notifications for new warnings while the app is open.
- Live dashboard (
/live): KPI tiles, a running alert feed (new, escalated and cleared signals with times), town and river boards, a refresh countdown, full screen, keep-screen-on and an optional chime for new warnings. A warning banner and a signal badge in the header show on every page.
- Phones first: bottom tab bar (Map, Live, Floods, Signals, More), card layouts in place of wide tables, safe-area padding for notched screens.
- Floods: a screening flood-risk score for every town (rain, nearest river, elevation), a flood-risk overlay and the NASA MODIS near-real-time flood-water layer on the map, rivers running high, and before/during/after flood guidance with emergency numbers (117, 119, 110, 1990, 1919).
- Any spot: tap anywhere on the map for its elevation (Copernicus 90 m DEM), weather, air quality, modelled river flow and flood risk; the spot is kept in the URL so it can be shared.
- Air quality page: US AQI, PM2.5, PM10, ozone, NO₂, dust and UV for every town, with health advice for each AQI band.
- Three languages: the whole interface in English, Sinhala and Tamil, including place and river names, weather descriptions, dates and chart axes. See
docs/TRANSLATIONS.md to help review the translations.
- Forecast honesty: each place page compares six global models (ECMWF, GFS, ICON, UKMO, ARPEGE, JMA) day by day with a high/medium/low agreement label, and scores the forecasts made 1–3 days ahead over the past week (rain-or-dry hits, rain and temperature error). No forecast is 100% accurate; the app shows how far to trust each one (
src/lib/forecastQuality.ts).
- Sea conditions for coastal towns: wave height and WMO sea state, swell, wave period and direction, sea temperature and a 5-day wave outlook (Open-Meteo Marine).
- Public API (
/api/v1/, documented at /developers): weather, air, flood risk, rivers, official gauges and signals as JSON, CSV, GeoJSON and Atom, rebuilt hourly, no key. See API below.
- CSV and PNG export, dark mode, mobile layout, offline banner, installable and readable offline (PWA).
This is the beginning of the README. Read the rest at the original. Read the full README ↗