
FLOODLINE: Which Road Closure Cuts Off the Most Hospitals? Mapping Urban Flood Resilience with Amazon Location Service
When a city floods, the danger often isn't the water — it's one blocked road severing access to a hospital. FLOODLINE builds a routable graph from 4,892 real Mumbai roads and 408 hospitals, then runs live Dijkstra/A* routing to simulate road closures and automatically rank the roads whose failure cuts off the most hospital journeys. Built on Amazon Location Service, AWS Amplify, OpenStreetMap, and the India Flood Inventory.
FLOODLINE — Hospital Access Under Road Disruption
Live demo: https://main.d114myt8ecchnn.amplifyapp.com\
Demo video: https://youtu.be/1LiSv\_UJg4s\
Source code (MIT): https://github.com/SK198-sabareesan-r/Map\_it
1. The problem
Every monsoon, cities like Mumbai flood. News coverage focuses on rainfall totals and water levels, but for the people living there the real emergency is access. When one arterial road goes underwater, an entire neighbourhood can lose its only viable route to the nearest hospital.
Conventional flood maps stop at showing where water collects. They do not answer the question that actually decides outcomes in an emergency:
When a road goes down, can people still reach a hospital — and which specific roads can the city least afford to lose?
FLOODLINE is built to answer exactly that, using real geographic data and a transparent routing engine, on an interactive Amazon Location Service map.
2. What FLOODLINE is
FLOODLINE is an interactive geospatial resilience simulator. It deliberately keeps three different kinds of information separate and honest, then combines them into a decision tool:
- Observed history — districts with a documented flood record (India Flood Inventory).
- Geographic context — the real road network and hospital locations (OpenStreetMap).
- Simulated outcomes — how hospital access changes when a road is closed, computed live in the browser.
The core idea: treat the road network as a graph, let the user (or the app itself) remove roads as if they were flooded, and measure what that does to hospital reachability.
3. The datasets — exactly what was used and how
3.1 Road network and hospitals — OpenStreetMap (ODbL)
- Source: OpenStreetMap, queried through the Overpass API.
- Area: a Mumbai-area bounding box (approximately
72.80, 19.00to72.95, 19.12).
- Extraction: a script issues an Overpass query for all
highwayways and allamenity=hospitalnodes/ways inside the bounding box.
- Filtering: the raw road set (~19,000 ways) is filtered down to the main drivable network —
motorway, trunk, primary, secondary, tertiaryand their_linkvariants — leaving 4,892 road features. This keeps the routing graph fast and the map readable.
- Hospitals: 408 hospital features with their real names (e.g. "Jevan Vikas Hospital", "JOY Hospital", "Inlaks Hospital").
- On the map: roads are drawn as line layers; hospitals are drawn as interactive markers.
3.2 Historical flood records — India Flood Inventory v3 (CC-BY)
- Source: India Flood Inventory (IFI-Impacts), produced by IIT Delhi in collaboration with the Indian Meteorological Department (IMD), covering 1967–2023. Downloaded from Zenodo.
- Processing: the inventory CSV (6,879 flood-event rows) is parsed, filtered to Maharashtra (1,017 matching records), and each record's reporting district is matched to a real district administrative boundary (Mumbai, Mumbai Suburban, Thane, Palghar, Raigad). The most recent ~60 events are kept for a readable map.
- On the map: rendered as polygon layers.
- Honesty note: these polygons show the district where a flood was reported, at administrative resolution. They are explicitly not measured street-level flood extents, and not a forecast. The UI and feature pop-ups state this clearly.
3.3 Basemap — Amazon Location Service
- The interactive vector basemap is served by Amazon Location Service through a scoped, restricted API key limited to map-rendering actions.
4. Features — everything you can do
4.1 Automatic headline finding (the app tells you the insight)
The instant the app loads, it runs a network-resilience analysis and surfaces a single, concrete finding at the top of the map, for example:
Closing K C Marg cuts off 5 of 20 tested hospital routes.
Most map projects are tools you must drive yourself. FLOODLINE leads with the answer, then lets you explore it.
4.2 Map layers you can toggle
- Flood history (blue district polygons)
- Hospitals (red markers; 408 of them)
- Road network (grey lines; 4,892 roads)
Each has an on/off toggle in the left panel, and a legend is shown on the map.
4.3 Build a baseline route
A five-step scenario builder in the left panel:
- Choose a hospital (destination). Once chosen, the map shows only that hospital with a labelled pin, so the view isn't congested by hundreds of markers.
- Set a start location by clicking anywhere on the map.
- Calculate baseline — FLOODLINE draws the shortest route on the real road graph (green line) and reports its distance.
4.4 Simulate a road closure (the "aha" moment)
- Pick roads to close — click any road on the map (it turns red), as if it were flooded.
- Simulate closure — the engine recalculates:
- If an alternative exists, it reroutes onto a longer detour (orange dashed line) and reports the exact extra distance and percentage increase.
- If no alternative exists, it reports the hospital as UNREACHABLE — a hidden single-point-of-failure in the network.
4.5 Critical-road ranking (the signature analysis)
FLOODLINE automatically tests dozens of hospital journeys (multiple start neighbourhoods × multiple hospitals) and ranks every road by its impact:
- how many journeys its closure disrupts,
- how many it cuts off entirely,
- the total extra detour distance it imposes.
The right panel shows the ranked list of the roads the city can least afford to lose. Click any entry and the map pans to and highlights that road.
4.6 Feature inspection
Click any flood district, hospital, or road to see its real attributes in the detail panel — event date, reporting cause, source dataset, road name/type, etc. — each clearly attributed.
5. How it works under the hood
5.1 The routing graph
- The 4,892-road network is compiled into a connected graph of 23,258 intersections (nodes) and 50,606 edges.
- Intersections become nodes; road segments become weighted edges; edge weight is geodesic distance (haversine), so results are distance-based shortest paths.
5.2 The algorithm
- A custom Dijkstra implementation (binary min-heap priority queue) computes exact shortest paths.
- A weighted-A* variant with a haversine heuristic powers the heavy critical-road analysis, which runs ~160 shortest-path computations in under two seconds using betweenness-ranked candidate selection (only the most-used roads are tested).
- Everything runs entirely in the browser — there is no third-party routing API. This is the deliberate design choice that makes arbitrary, hypothetical road closures possible: a closure simply removes edges from the graph before re-running the search.
5.3 Robustness details
- Snap guard: start and destination points are snapped to the nearest graph node, with a distance threshold so clicks far from the network are rejected with a helpful message rather than returning a misleading route.
- Reproducible finding: the headline analysis is deterministic over the fixed study area, so the same insight is reproducible for any judge who opens the demo.
6. AWS architecture
AWS service | Role in the project |
|---|---|
Amazon Location Service | Renders the interactive vector basemap (restricted, map-only API key) |
AWS Amplify Hosting | Serves the application publicly over HTTPS |
Amazon S3 | Stores the prepared GeoJSON datasets and build artifacts |
Data pipeline: OpenStreetMap (Overpass API) → filter/convert to GeoJSON → India Flood Inventory (Zenodo CSV) → map to district polygons → all GeoJSON bundled with the app and drawn on the Amazon Location Service map. The app is a self-contained static site: once loaded, all routing happens client-side, so it stays fast and cheap to host.
7. How to use it (quick walkthrough)
- Open the live demo — note the automatic finding banner at the top.
- Read the ranked "Most critical roads" panel on the right.
- Pick a hospital from the dropdown; the map focuses on it.
- Click "Pick start on map" and click a point across town.
- Click "Calculate baseline" to draw the green route.
- Click "Pick roads to close", click a road on that route, then "Simulate closure".
- Read the result in the bottom bar — a longer detour, or "unreachable".
- Click any road in the critical-roads list to jump to it on the map.
8. Why it matters
FLOODLINE reframes flood mapping from "where did it flood" to "what breaks when it does." It surfaces infrastructure dependencies that are invisible on an ordinary map, using transparent, reproducible calculations a planner can trust. Because the engine is city-agnostic, pointing the extraction bounding box at any other city (Chennai, Patna, Jakarta, anywhere with OSM coverage) produces the same analysis with no code changes.
9. Limitations (stated plainly)
- Routing is distance-based. It does not model one-way streets, turn restrictions, real-time traffic, or verified live road conditions.
- A simulated closure is a hypothetical experiment on the modelled graph — not real-time navigation and not a flood forecast.
- Historical flood records indicate districts with a flood history, not current street conditions or measured inundation extents.
These limitations are surfaced directly in the application so results are never over-interpreted.
10. Reproducibility and licensing
The full source is public under the MIT license. Data-preparation scripts regenerate every dataset from its original source, and the study-area bounding box is a single configurable value.
- Roads & hospitals: © OpenStreetMap contributors (ODbL)
- Flood history: India Flood Inventory v3 (IIT Delhi / IMD, 1967–2023), CC-BY
- Basemap: Amazon Location Service (Esri)
- Code: MIT — https://github.com/SK198-sabareesan-r/Map\_it
No personal or sensitive data is used anywhere in the project.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article