What it is
BahaWatch answers one question for a street or barangay (neighbourhood): Babaha ba? — “Will it flood?” — and says how deep the water is for someone walking, riding a motorcycle or driving.
This demo runs on synthetic data. Streets, buildings, terrain and flood hazard maps are real open data. The sensor readings, storms and neighbour reports are made up by a storm generator.
In a real deployment, the dashboard is connected to real sensors. Each unit sends its water level to the dashboard’s server every 10 minutes, and the server combines those readings with the flood model and the datasets below to estimate what is happening on the ground, street by street. Only the source of the readings changes; the model, the rule and the maps are the same code.
Not a forecast. Not for emergency use. Follow PAGASA and local government advisories.
The sites
- 25 PhilDev partner campuses in Luzon, the Visayas and Mindanao. Each has a 3 km map with eight proposed sensor spots.
- Two neighbourhood pilots: Teachers Village, Quezon City, and Brgy. San Joaquin, Mabalacat City, Pampanga.
- UC Berkeley, California: an experiment, not a planned site. We ran the same method on very accurate terrainThe US Geological Survey’s 1 m lidar map: an aircraft laser survey of the bare ground. Nothing like it is openly available for most of the Philippines, so Berkeley shows how the method behaves when the ground heights are right. to see how it behaves when the ground heights are right.
How it works
- Sensors measure water on the street (simulated in this demo). Each household unitA small ultrasonic sensor on a gate post at the street’s edge, hosted by a household. It points down at the road and measures the distance to the surface: less distance, more water. See Sensor units below. sends the water depth in front of it every 10 minutes over LoRaWANA long-range, low-power radio network for small sensors. One gateway can hear units a few kilometres away in a city, each reading is only a few bytes, and it does not depend on mobile data, which often jams during storms..
- The model spreads that water over the map. At each wet sensor it sets a water level (ground height + measured depth) and lets it spread to nearby lower ground, until the ground rises above it. It fades with distanceThe water level drops 1 cm for every 15 m it travels, and spreading stops after about 1.2 km. Water also never spreads into ground more than 45 cm deeper than the sensor saw, so a 20 cm reading on a slope can’t flood a whole valley below it. Both rules keep the map on the cautious side. and goes around buildingsThe map is a grid of 7.5 m squares. A square at least 75% covered by building footprints blocks water; streets and creeks never block. Streets are cut 0.5 m into the terrain so they carry water, as real streets do.. No reading, no flood on the map.
- A rule gives the answer. The Babaha ba? (“Will it flood?”) ruleChecked in order; the first match wins. Nothing newer than 20 minutes: “No fresh data”. The sensor here reads 5 cm or more, or is rising to it within an hour: Oo (yes). Three or more neighbours report flooding within 1 km in the last hour, or heavy rain falls on a mapped hazard zone: Baka (maybe). One or two reports, or a trace at the sensor: Baka (maybe). Otherwise Hindi (no). Reports alone never give Oo; only a sensor can. combines sensors, neighbour reports and rain into Oo (yes), Baka (maybe), Hindi (no) or “No fresh data”.
- Depth becomes something you can act on. Water is described as gutter-, half-knee-, knee- or waist-deep, and as passable or not for carsFrom the MMDA Flood Gauge: half-tire (33 cm) is not passable to light vehicles, tire level (66 cm) is not passable to any vehicle. From 25 cm we say “drive slowly”, where Mamuyac et al. (2025) saw lane closures begin in MMDA CCTV footage. and motorcyclesOur own rule, because the MMDA gauge has none for motorcycles: slow from 15 cm, where the engine sits; not passable from 30 cm, the height of the exhaust and footpegs, where bikes stall..
Two views: the simple view for residents (one answer, the street list, a map) and Details for operators and researchers (storm scenarios, a 36-hour timeline, each sensor’s readings, the NOAH layer).
Data
All open data, cut to each site by our pipeline and stored with the page.
- Ground height
- FABDEMA global map of ground height with buildings and trees removed (Hawker et al. 2022, University of Bristol), made from the 30 m Copernicus satellite elevation map with machine learning. Bare ground is what water flows over. Free for non-commercial use., 30 m, smoothed onto the 7.5 m grid. USGS 1 m lidar at Berkeley.Where water can go.
- Buildings
- FootprintsBuilding outlines traced from satellite images by Google and Microsoft, merged with OpenStreetMap. They can miss small, new or informal buildings, and can’t tell a house from a warehouse or count floors. from Google Open Buildings, Microsoft and OpenStreetMap, combined by VIDA.What blocks water; buildings counted in flooded areas; the map.
- Streets, creeks, names
- OpenStreetMapA free world map drawn by volunteers, like a Wikipedia for maps. Coverage in Philippine cities is good; small alleys and creeks can be missing..Streets cut into the terrain as water paths; street names in answers; the map.
- Flood hazard
- UP Project NOAHFlood hazard maps from the University of the Philippines (Project NOAH, now the UP Resilience Institute), modelled for rain heavy enough to come once in 5, 25 or 100 years on average. They show mostly river and overland flooding; ponding from blocked drains often doesn’t appear. 5-, 25- and 100-year maps.A reference layer to compare with; the rain rule; choosing sensor spots; shaping the simulated storms. Never used to draw the flood.
- Barangays (neighbourhoods)
- PSA and NAMRIA boundaries, via OCHA HDX.“My barangay” answers.
- Depth levels
- MMDA Flood Gauge; Mamuyac et al. 2025, Natural Hazards.Depth words and passability.
- Rain
- Open-Meteo hourly rain, in live mode only (not switched on yet).The rain step of the rule.
- Terrain check
- NASA ICESat-2A NASA satellite laser that measures ground height along narrow tracks, to within tens of centimetres on open ground. We used 17,936 of its ground points at 26 sites as the reference to test FABDEM. ground heights, 2019–2026.Measuring how wrong the terrain is (see Accuracy).
- Simulated
- Sensor readings, storms, neighbour reports.Everything that moves.
How the data are processed
For researchers who want the details: every step from the raw downloads to the answer on a phone. Scripts are named as they are in the repository.
-
1Open data, downloaded once
- FABDEM V1-2 ground height, 30 m tiles, EGM2008 heights
- OpenStreetMap Philippines extract (Geofabrik): streets, creeks, names, campus outlines
- Building footprints (Google, Microsoft, OpenStreetMap, combined by VIDA)
- NOAH hazard maps, 5-, 25- and 100-year, per province
- Barangay boundaries (PSA, NAMRIA via OCHA HDX)
- PhilDev campus list (pipeline/campuses.csv)
-
2Cut to each site pipeline/run_pc.py
- find: match each campus name to its OpenStreetMap outline.
- cut: a box of about 3 × 3 km around each campus or pilot: terrain tiles merged and clipped, buildings, streets and creeks, NOAH polygons, barangays and the outline.
-
3Build each site file build_data.py
- Grid. 400 × 400 squares of 7.5 m; terrain kept on a 15 m grid inside the file.
- Terrain. FABDEM sampled onto the 15 m grid and smoothed (Gaussian, 1 cell), then rebuilt at 7.5 m by bilinear interpolation.
- Streets. Mapped streets become a 7.5 m street mask, cut 0.5 m below the lowest ground within 5 × 5 squares (about 40 m), so streets carry water.
- Buildings. Footprints become the share of each square that is built; a square at least 75% built blocks water (streets and creeks never block).
- Sea. Squares at or below 0 m that connect to the edge of the box.
- Hazard and places. NOAH classes per square for each return period; barangay and street places with their sensors (
tools/build_places.py).
- Sensor spots. Placement score (lowness, hazard, nearness to water), spaced 300 m apart; each unit snapped to its street square and given that square’s ground height.
- Checks. File size (≤ 250 KB compressed), spacing, units inside the box (
tools/check_site_data.py), then written to data/<site>.json.
-
4Map tiles and labels
- Streets, buildings and waterways as vector tiles (tippecanoe → PMTiles,
tools/build_basemap.py), served from our own site.
- Map-label glyphs in Atkinson Hyperlegible Next (
tools/build_glyphs.py).
-
5In the browser, at every reading
- Reading in. Each unit’s depth (here from the storm generator; live, from the server).
- Water level. Ground height at the unit’s street square + depth.
- Spread. From the street square to neighbouring squares (up, down, left, right). A square floods if 2 cm < level − 1 cm per 15 m travelled − ground ≤ depth + 45 cm; otherwise the water stops there. Blocked and sea squares are skipped; the spread ends 1.2 km out.
- Overlaps. Where two units reach the same square, the deeper estimate wins, and the square remembers which unit it came from.
- Drawing. Depth sampled four times finer (about 1.9 m) so the shoreline follows the terrain; building outlines cut out of the water; colours from the depth spectrum.
- Counts. Buildings in flooded squares, streets cut, and a rough residents estimate (4.2 people per building).
- Answer. The Babaha ba? (“Will it flood?”) rule (
shared/verdict.js) from sensors, neighbour reports and rain.
-
6Live mode Designed, not switched on
- Units’ readings arrive over LoRaWAN at a small server (Cloudflare Workers and a D1 database, on free plans), with hourly rain from Open-Meteo and neighbours’ reports.
- Every 5 minutes it works out each place’s answer with the same rule file the demo uses, so demo and live answers can never drift apart.
Code: MIT licence. FABDEM’s licence is non-commercial (CC BY-NC-SA 4.0), so the Philippine site files are too. Full list in the repository’s DATA-LICENSE.md.
Sensor units
No units are installed yet. This is what the dashboard assumes about a unit, written down so it can be checked in the field.
The device
An ultrasonic distance sensorIt sends a short sound pulse, too high to hear, and times the echo from the surface below. Nothing touches the floodwater, so there is less dirt and damage than with a sensor sitting in the water. pointing down at the street, with a LoRaWAN radio and a battery. About US$210 per unit (our estimate). Each reading carries only the unit’s ID, the time, the water depth and the unit’s location.
How it is mounted Our assumptions, not yet field-tested
- Where
- On a household gate post or front wall at the street’s edge, with the household’s consent.
- Looking at
- Street pavement straight below: not the yard, a canal or a drain opening. A clear patch about half a metre wide, where cars don’t usually park.
- Height
- About 2 m above the roadThe prototype’s ultrasonic sensor reads distances from 0.5 to 10 m. At 2 m a unit still reads water up to about 1.5 m deep, past the waist-deep level the dashboard shows, and it sits above most heads and splashes. A person or vehicle passing under gives a short false reading, so a unit should report the median of several pings..
- Zero point
- At install, on a dry day, the unit records the distance to dry pavement. Water depth = that distance − the distance now.
- Ground height
- Taken from the terrain map at the unit’s street square, not surveyed. Terrain error shifts the unit’s water level by the same amount.
- Radio
- Within range of a LoRaWAN gateway; one reading every 10 to 15 minutes (the demo simulates every 10).
- Warning
- The unit’s microcontroller tracks how fast the water rises and sends a warning before it reaches a set level.
Where the spots come from
Teachers Village’s eight units were placed by hand along its low streets. Everywhere else a rule picks themCandidates are houses within 25 m of a street and at least 300 m inside the map’s edge. Each gets a score: 0.5 × how low it sits (the share of ground within 300 m that is higher) + 0.3 × NOAH hazard + 0.2 × closeness to a creek or river (zero at 300 m). The best eight are picked at least 300 m apart (250 m, then 200 m, if eight don’t fit).: low ground, mapped hazard, near water, spread apart. On a campus, unit 01 is on campus and the rest are in the barangays (neighbourhoods) around it; in San Joaquin all eight are inside the barangay.
The spots are proposals, not surveyed or agreed with residents.
Accuracy and limits
The depth at a sensor is measured. How far the water spreads from it is only as good as the terrain map, and the terrain is the weakest part.
Terrain error, measured
We compared FABDEM with 17,936 ICESat-2 ground points at 26 sites:
- Typical error about 1.4 m (NMADNormalised median absolute deviation: a measure of typical error that isn’t thrown off by a few wild points. For roughly normal errors, about two-thirds of points fall within ±1 NMAD.); median +0.66 m (the map sits a little above the ground).
- 46% of points within 1 m, 72% within 2 m.
- Open campuses (CLSU, LLCC, MSU-IIT, CMU): 0.4–0.8 m.
- Old Manila core (UST, FEU Tech, Mapúa, UDM): the map is about 2 m too high; only 2–12% of points within 1 m.
Error grows with how built-up a place is. In tight streets the satellite can mistake roofs for ground, so the real error there may be larger.
Why a terrain error is not the whole story
The water level is set from the map’s own ground height at the sensor, and then compared with the map’s ground height elsewhere. An error that is the same everywhere (the whole map sitting 1 m too high) cancels out. What moves the edges is error that changes from street to street, which is what NMAD measures. A sensor sitting on a spot the map gets badly wrong, though, shifts its whole patch of water.
Every setting the model uses
| Setting | Value | Why, and what it costs |
| Grid | 7.5 m squares; terrain detail 15 m (FABDEM is 30 m) | Streets in barangays (neighbourhoods) are often 4–8 m wide. A finer grid separates streets from houses but adds no height detail. |
| Smoothing | Gaussian, 1 cell (15 m) | Removes satellite noise; also softens real kerbs and small walls. |
| Street cut | 0.5 m below the lowest ground within about 40 m | Makes streets connected channels, as they are; a guess, not a survey. |
| Buildings | A square ≥ 75% built blocks water | Water goes around blocks; real houses let some water in, and merged footprints can close real alleys. |
| Wet threshold | Over 2 cm | Below this, a square is treated as dry. |
| Depth band | Up to the reading + 45 cm | Stops a shallow reading on a slope from flooding a deep valley below it. |
| Fading | 1 cm per 15 m from the sensor | Keeps far estimates cautious; real water surfaces are nearly flat over short distances. |
| Reach | 1.2 km from each sensor | Beyond this, the map says nothing rather than guess. |
| Residents | 4.2 people per building | Close to the average Philippine household; buildings with several households are undercounted. |
| Fresh data | 20 minutes | Two missed readings; after that the answer becomes “No fresh data”. |
| Oo (yes) | Sensor ≥ 5 cm, or rising to it within 60 minutes | Only a sensor can say yes. |
| Baka (maybe) | 3 or more reports within 1 km in an hour; rain ≥ 7.5 mm/h on a NOAH 5- or 25-year zone, or ≥ 15 mm/h on any mapped zone; 1–2 reports; or a 1 cm trace | The rain levels follow PAGASA’s yellow and orange rainfall warnings. A dry sensor within 500 m is shown against reports. |
| Passability | Cars: slow from 25 cm, not light vehicles from 33 cm, none from 66 cm. Motorcycles: slow from 15 cm, not passable from 30 cm. | Car levels from the MMDA Flood Gauge and Mamuyac et al. (2025); motorcycle levels are our own rule. |
The simulated readings
Each storm is a rain pulse over 36 hours (two pulses for a typhoon). A unit’s depth = (rain × how susceptible its spot is − 2 cm) × a small random factor, capped at 90 cm. Susceptibility grows with how low the spot is and its NOAH hazard class. Replays are identical (a fixed random seed). This makes the demo look plausible; it is not a forecast and is not evidence that the model is right.
What has not been checked yet
- No comparison with real floods. No mapped extent has been compared with an observed flood (satellite flood maps, geotagged photos, MMDA reports). That is the next step.
- No real readings. The thresholds (5 cm, 20 minutes, 45 cm, 1 cm per 15 m) are reasoned, not tuned on data.
- Sensor accuracy in rain, heat and debris, and how often a passer-by gives a false reading, still have to be measured on the bench and in the field.
- Edges are no sharper than the terrain. The shoreline is drawn about 1.9 m fine, but it is interpolated from 15 m terrain.
Other limits and biases
- No moving water. The model does not simulate rain, runoff, drains, flow speed or volume. It shows where the measured water level can reach; places far from any sensor stay blank.
- New 7.5 m grid, not yet validated. Finer building squares block more water; on dense campuses the spread shrank (UST: 90 to 48 ha at the same storm moment). It may now understate floods there.
- Buildings. Footprints miss small, new and informal homes, so dense informal areas are undercounted. “Residents affected” is a rough multiple of buildings.
- The demo agrees with NOAH by design. The simulated storms flood low, NOAH-flagged spots first, so the demo looking plausible is not evidence that the model is right.
- Sensor spots favour low ground. Good for seeing water early, but higher streets get answers from reports and rain only (“No sensor here yet”).
- Who gets heard. Reporting needs a smartphone and data; hosting needs a gate post and a willing household. Renters, older residents and informal settlers may be under-represented.
- Not modelled: storm surge, tides, dam releases.
- Languages. Cebuano, Ilokano, Hiligaynon and Kapampangan were drafted without a native speaker and are marked for review.
Future work
- Real sensors. Bench-test the unit, then a pilot street in Teachers Village or San Joaquin; replay a recorded storm on the dashboard.
- Check against real floods. Compare mapped extents with observed flooding from a past typhoon: MMDA flood reports, geotagged photos, barangay (village) records.
- Better terrain. Test FathomDEMA newer bare-earth elevation map (Fathom, 2025) built for flood modelling. Its authors report smaller errors than FABDEM, including in cities; we have asked for access and will run the same ICESat-2 check on it. (access requested) and 1 m Phil-LiDAR maps where available; survey each unit’s ground height at install.
- Water that moves. Try a simple two-dimensional flow model for direction and timing, and add drainage where it is mapped.
- Count flooded buildings by outline, not by grid square.
- Go live. Switch on the server for real answers, rain and reports; add SMS for phones without data.
- Design with residents. Work with barangays and households on where units go, who hosts them and how the answer is worded; native-speaker review of every language.
- Data governance. Agree who owns the readings and reports, and how long they are kept.
FAQ
Is any of this real?
The map is: streets, buildings, terrain, barangays (neighbourhoods) and NOAH hazard layers all come from open data. The sensor readings, storms and neighbour reports are synthetic, and every page says so. In a real deployment, sensors send their readings to the dashboard’s server, and everything after that (the model, the answer rule, the maps) runs exactly as in the demo.
Why not just use the NOAH hazard maps?
NOAH shows where floods can happen in a storm of a given size, not what is happening now. It is modelled mainly for rivers and overland flow, so it often misses street ponding from blocked drains; in Teachers Village it is blank across the Maginhawa interior, which is known to flood. BahaWatch keeps NOAH as a layer to compare against.
How accurate is the flood map?
At a sensor, as accurate as the sensor. Away from it, the spread depends on terrain, which is typically about 1.4 m off and about 2 m too high in old Manila. Read the extents as a guide to where water is likely, not a street-by-street survey. Details under Accuracy and limits.
Is it a forecast?
No. It maps water measured now. Its only look-ahead is one hour: a sensor rising fast enough to reach 5 cm within the hour already counts as Oo (yes). For warnings, follow PAGASA and your local government.
Why ultrasonic sensors, not pressure sensors or cameras?
An ultrasonic unit never touches the floodwater, is cheap, and sends one number. A pressure sensor must sit in dirty water on the road; a camera sends images, which needs more bandwidth and raises privacy concerns. The trade-offs: a short blind zone, false echoes from people or debris, and a reading that needs correcting for air temperature.
What if power or signal is lost?
Every answer shows its age. If nothing is newer than 20 minutes, the answer becomes “No fresh data”; it never says Hindi (no) on old data. The page itself opens without signal and shows the last answer with its time.
How do you stop fake or mistaken reports?
Reports alone can only raise Baka (maybe); only a sensor can say Oo (yes). It takes three different phones within 1 km in the last hour, one report per phone per place every 10 minutes, and a report from more than 2 km away is refused. Reports expire after an hour, and a dry sensor nearby is shown against them.
What do you store about people?
No accounts, names or phone numbers. A report’s position is rounded to about 100 m and used only when the phone is within 1 km of the place. Report IDs are erased after an hour and raw reports deleted after 30 days. This applies in live mode; the demo sends nothing.
What does it cost to run?
The site is plain files on GitHub Pages, with its own map tiles: no running cost. The live server is designed for Cloudflare’s free plan (not switched on yet). Hardware: about US$210 per unit (our estimate), plus a LoRaWAN gateway per area.
Does it work on cheap phones and slow connections?
A campus page loaded in about 3 seconds on a simulated fast 3G connection in our tests; each site’s data is at most 250 KB compressed. Once opened, the page opens again without signal. It comes in six languages, uses shapes as well as colours, and has screen-reader text for every map.
Can it be set up somewhere new?
Yes, anywhere the open datasets cover: give the pipeline a map box and it cuts terrain, buildings, streets, NOAH layers and barangays, then proposes sensor spots. San Joaquin was added this way. NOAH coverage and footprint quality vary by province.
Why is UC Berkeley on a Philippine dashboard?
It was an experiment. Berkeley has 1 m lidar terrain, so we ran the same method there to see how it behaves on well-known ground, and to try the dashboard with US units and wording. It is not a planned deployment.
Why a 7.5 m grid?
Barangay streets are often 4–8 m wide. With 15 m squares, houses and streets merged and water leaked through blocks. Buildings and streets are now on 7.5 m squares; the terrain keeps FABDEM’s detail, since finer squares add no height information.
BahaWatch is a research prototype. Map data © OpenStreetMap contributors; terrain FABDEM © University of Bristol; hazard UP NOAH / UP Resilience Institute; boundaries PSA / NAMRIA.