To provide some background, I live in Sri Lanka, and just a few weeks ago we experienced one of the most severe flood events in decades.
I live in Kaduwela, a town close to Colombo, where we face a risk of flooding even when there is little or no rainfall in our immediate area. This is mainly because one of Sri Lanka’s major rivers, the Kelani River, flows very close to us. When there is heavy rainfall in the upstream areas of the Kelani River, it naturally creates vulnerability for anyone living along the riverbanks downstream.
Between 27th and 29th November, Cyclone Ditwah approached Sri Lanka and made landfall on 28th November 2025, unleashing extremely heavy rainfall. This caused rivers to overflow and resulted in widespread flooding across the country. Most upstream areas of the Kelani River received over 200 mm of rain within a 24-hour period, putting immense stress on the entire upstream reservoir and river system. As a result, water levels exceeded capacity and surged rapidly into downstream areas, triggering landslides and floods across the island.
Living in Colombo, we began to feel the pressure around 29th November. Although there was already some level of flooding caused directly by Cyclone Ditwah, the situation worsened by the hour due to continuous heavy rainfall in the upstream regions of the Kelani River. It had already been predicted that Colombo could face its worst flooding in decades. Significant floods were previously reported in 1989 and 2016, and forecasts suggested that this event could be even more severe.
We were fortunate to live in an area that was not directly flooded during either the 1989 or 2016 floods. However, our area is still highly vulnerable—roads get flooded quickly, exit routes become blocked, and travel can be completely cut off even without water entering homes.
There were numerous weather forecasts being released, and naturally, during emergencies like this, we tend to glue ourselves in front of the TV, constantly watching 24-hour news coverage. At that point, I began to wonder whether there was a more scientific and data-driven way to assess the actual flood risk.
The key questions I was trying to answer were:
• When will my area experience its worst flooding?
• When will the flood risk subside?
• Will floodwaters reach my home?
I believe these are the three fundamental questions anyone living in a flood-risk zone tries to figure out during such events.
In our case, the situation was slightly easier to analyze because there was very little rainfall in our immediate area. The primary risk was coming from upstream flooding. This narrowed the problem down to understanding when large volumes of water would travel from upstream to downstream through the Kelani River, and how that surge would impact our location.
To identify a solution, the next step was to better understand the Kelani River itself. The image below provides a high-level view of the problem at hand, illustrating the course of the Kelani River.
Water flows through many areas, but the critical downstream path is:
Upstream → Kitulgala → Glencourse → Hanwella → Kaduwela → Colombo
All rainfall received in the upstream regions of the Kelani River eventually flows downstream through this path. Therefore, any significant increase in upstream rainfall directly impacts water levels in Hanwella, Kaduwela, and Colombo, making these areas particularly vulnerable during extreme weather events.
Next finding the data related to these key areas, there was meter reading happening regularly and data was available at https://www.dmc.gov.lk/.
Date & Time (25/11/2025) Nagalagam Street (m) Hanwella (m) Glencourse (m) Kithulgala (m)
18:30 2.20 2.38 10.30 1.78
21:30 1.60 2.26 10.21 1.89
Nagalagam Street is the river gauging station located in Colombo
The way flooding unfolds along the Kelani River is relatively predictable:
- Upstream reservoirs and river sections begin to fill first
- Water then flows downstream through Kitulgala
- By monitoring water levels from Kitulgala to Nagalagam Street, we can effectively observe the entire flood progression
- When water levels peak at Kitulgala, they subsequently recede there and then peak downstream at Glencourse, followed by Hanwella and finally Nagalagam Street This understanding was sufficient for me to build a quick GenAI application to estimate when flooding might impact Colombo and Kaduwela. I used AWS PartyRock to build this application.
I designed a prompt for the app to analyze water levels along the Kelani River and estimate flood risk for Colombo and surrounding areas. Here’s a structured breakdown of each component:
1.Extract Latest Readings
Instruction:
Extract the most recent water level readings for each station: Kithulgala, Glencourse, Hanwella, Nagalagam Street.
Purpose:
• Capture the current state of the river at multiple points.
• Provides the starting point for all subsequent calculations and risk estimates.
• Ensures analysis is based on real-time conditions, not historical averages.
2.Compare Against 2016 Peaks
Instruction:
Compare current water levels with 2016 flood peaks:
• Nagalagam Street: 7.65 m
• Hanwella: 10.51 m
• Glencourse: 19.80 m
• Kithulgala: N/A
Purpose:
• Provides a reference baseline for flood severity.
• Highlights areas exceeding historic flood levels, which helps prioritize alerts and resources.
3.Calculate Flood Height
Instruction:
Flood Height = Current Level − 2016 Peak
Purpose:
• Quantifies how much higher or lower current water levels are compared to the worst-known historical event.
• Critical for understanding the magnitude of risk at each station.
4.Estimate Kaduwela Level Using Proxy
Instruction:
Kaduwela Current ≈ Hanwella Current − 0.6–0.8 m
Kaduwela 2016 Peak = 10.51 m (Hanwella proxy)
Purpose:
• Kaduwela doesn’t have direct measurements in real time.
• Using hydrological proxies allows estimation of water levels based on upstream measurements.
• Provides continuous flood-risk monitoring for a critical transition zone between middle-basin and downstream areas.
5.Hydrological Principle: Transition Zone Dynamics
Instruction:
• Kaduwela sits between Hanwella and Nagalagam Street.
• Water reaches Kaduwela earlier than Nagalagam Street and recedes earlier.
• Estimate timing differences:
o Kaduwela resolves 6–12 hours before Nagalagam Street
o If Nagalagam = 24–36 hours, Kaduwela = 12–18 hours
Purpose:
• Explains flood propagation along the river.
• Ensures the model predicts not only peak levels but also timing.
• Helps residents and authorities prepare for upstream vs downstream risk.
6.Account for Hydrological and Geographical Factors
Instruction (improved):
Account for inter-station distances, river gradient, catchment size, flow velocity, elevation changes, and downstream lag time to produce more accurate flood-level estimates and timing predictions.
Purpose:
• Adds real-world context to the calculations.
• Recognizes that water doesn’t flow instantaneously: topography, distance, and river dynamics affect flood timing and severity.
• Improves accuracy of flood predictions across multiple stations.
7.Generate Markdown Table
Instruction:
• Include all five locations in downstream order:
- Kithulgala (upstream)
- Glencourse (upper middle)
- Hanwella (middle)
- Kaduwela (transition zone)
- Nagalagam Street / Colombo (downstream) • Columns include: o Location o 2016 Max Level o Current Level o Flood Height vs 2016 o Status Now (🟢/🟡/🔴) o Trend (🟢/🟡/🔴) o Peak Status (🟢/🟡/🔴) o New Flood Risk o Notes Purpose: • Provides a clear visual summary for decision-makers. • Uses color-coded indicators for immediate understanding of risk and trend. • Ensures consistency in reporting across all stations.
8.Status Indicators Explained
Instruction:
• Status Now: 🟢 Low | 🟡 Moderate | 🔴 High/Critical
• Trend: 🟢 Falling fast | 🟡 Slowly falling | 🔴 Rising
• Peak Status: 🟢 Passed | 🟡 At peak | 🔴 Still coming
• New Flood Risk: Describes residual risks (secondary hazards, recurrence, duration)
Purpose:
• Translates numeric data into human-readable risk levels.
• Helps residents and authorities quickly identify which areas need attention now.
• Incorporates residual risk after peak passes.
9.Example Rows
• Glencourse: Peak passed, still elevated, water moving downstream
• Kaduwela: At or near peak, transition zone, clears before Colombo
• Nagalagam Street: Still critical, longest drainage time
Purpose:
• Shows how to interpret table data for decision-making.
• Demonstrates flow progression and lag effects along the river.
10.Summary Paragraph
Instruction:
• Explain upstream recession, Hanwella’s peak, Kaduwela as transition zone, Nagalagam Street as longest residual risk
• Highlight timing cascade, residual hazards, recurrence vulnerability, infrastructure exposure, contaminated waters
• Provide safety recommendations prioritizing areas with longest drainage times
Purpose:
• Converts table data into a narrative that is actionable.
• Provides context for emergency response and public awareness.
• Completes the flood analysis workflow from data → calculation → visualization → actionable insights.
Output
Details About the AI Model
- I used Claude 3.5 Sonnet V2 for this project because of its strong reasoning capabilities and structured output formatting, which made it well-suited for analyzing hydrological data and generating clear, actionable tables.
- I deliberately disabled internet access for the model, as I was already supplying all the relevant, real-time water-level data. This ensured that the analysis relied solely on the data I provided, avoiding inconsistencies or external noise.
- I set the temperature to 0 to encourage focused, deterministic responses. This reduced variability and ensured that the output was predictable, consistent, and easy to interpret, which is critical when analyzing flood risk and producing actionable tables.
This approach allowed me to gain a clear understanding of peak water levels at each location, including when the peak would occur at Kaduwela and when the flood risk would subside. It provided a sense of control and reassurance during an otherwise uncertain situation.
The next step was to estimate the actual flood risk for my location. While precise predictions are inherently difficult, I developed a practical workaround. Since the floodwaters were nearby, I could pinpoint exact locations of two key points, their water levels, and combine that with the precise location and elevation of my house. Using this data, I had the model generate flood projections for my property. It’s not a perfect solution, but it was a feasible and useful approach given the circumstances.
Pros
- Personalized Risk Assessment: Provides flood projections specific to your house/location, rather than general area-wide warnings.
- Early Awareness: Helps anticipate peak water levels and timing, giving time to prepare and take preventive measures.
- Data-Driven Comfort: Using actual upstream measurements combined with your location offers a sense of control and situational awareness during uncertain flood events.
Cons
- Limited Accuracy: The approach depends on proxy data and approximations, so predictions may not perfectly reflect real conditions.
- Point-Specific: Works well for specific locations, but cannot provide a comprehensive view for wider areas or multiple properties.
- Model Limitations: The AI model may miss sudden changes in rainfall or upstream surges, as it relies only on the provided data.
How I Used AI to Assess Flood Risk at My Location
To understand the flood risk for my house during the recent Kelani River floods, I created a location-based AI analysis. I approached it as if I were a hydrological flood risk analyst, providing the AI with reference points along the river and my home’s location. Here’s how the process worked:
Reference Points and User Location
I provided the AI with two reference points along the river and my house location:
Reference Point 1
Coordinates: [Reference Point 1 - Coordinates]
Current Flood Level: [Reference Point 1 - Flood Level]
Elevation: [Reference Point 1 - Elevation]
Reference Point 2
Coordinates: [Reference Point 2 - Coordinates]
Current Flood Level: [Reference Point 2 - Flood Level]
Elevation: [Reference Point 2 - Elevation]
User’s Location (My House)
Coordinates: [Your Location - Coordinates]
Elevation: [Your Location - Elevation]
Step 1: Location Proximity Analysis
The AI calculated which reference point is closer to my house and estimated distances in meters. This helps understand which upstream or downstream readings are more relevant for my flood risk.
Step 2: Elevation and Topography
Using elevation data, the AI analyzed how terrain affects flood propagation.
Higher elevations naturally have lower flood risk.
Lower elevations or downhill positions are more vulnerable.
Step 3: Flood Level Interpolation
The AI estimated my house’s likely flood level based on:
Linear interpolation between the two reference points
Elevation differences (water flows downhill)
Upstream vs downstream position in the river basin
Whether my location is uphill or downhill from the reference points
This gave a custom flood level prediction for my specific location.
Step 4: Risk Assessment
Using color-coded indicators, the AI assessed the flood risk:
🟢 GREEN – Low risk, safe, flood levels below dangerous thresholds
🟡 AMBER – Moderate risk, approaching warning levels, caution advised
🔴 RED – High risk, at or above thresholds, immediate concern
Step 5: Estimated Flood Level
The AI provided an interpolated flood level estimate for my house based on the reference points, factoring in both water level and elevation.
Step 6: Comparison with Reference Points
It explained how my location compares to the reference points in terms of elevation and expected flooding, helping me understand whether I was upstream, downstream, or in a critical transition zone.
Step 7: Water Depth Calculation
By subtracting my house’s elevation from the projected flood level, the AI calculated the expected water depth at my location.
Step 8: Recommendations
The AI provided actionable advice based on the predicted flood risk:
Evacuation timing
Preparing flood barriers
Monitoring upstream changes
Step 9: Timing Estimates
Finally, the AI estimated when the flood risk would peak at my house and when it would recede, based on trends observed between the two reference points.
Why This Approach Works
This location-based analysis allows homeowners to:
Understand their specific flood risk, not just general area warnings
See expected water levels and timing
Make informed decisions about safety and preparation
By combining reference points, elevation data, and interpolation, this method provides a practical, data-driven solution for assessing flood risk at any individual location along a river.
Test the App - https://partyrock.aws/u/sre/qfVrummDF/Location-Based-Flood-Predictions
Of course, this approach is not perfect, but it gave me something constructive to focus on during a very stressful period. It allowed me to feel like I had some control over what was happening—at least, that’s how I like to think about it.
Next Steps
- This solution could be improved into a full system where anyone can provide their Google Maps location, and the system predicts their flood risk automatically.
- We could incorporate additional data points and more sophisticated scientific formulas to make the predictions more robust and accurate.
- The AI model could be integrated with advanced forecasting capabilities, including rainfall projections and upstream river data, for real-time monitoring.
- If anyone is interested in taking this project to the next level, feel free to send me a message on LinkedIn.



Top comments (0)