Rapid situational mapping from open data in Python: the Valencia floods of 29 October 2024

Build a first situation map of a disaster from open data in Python. For the Valencia DANA floods of October 2024, read the Copernicus EMS activation and its first flood delineation, add municipalities, modelled rainfall from Open-Meteo and OpenStreetMap hospitals, schools, fire stations and bridges as they were on the morning of the flood, then make a one-page map, an interactive Folium map and a 'what we know' table.

Level
Beginner
Tested with
Python 3.12
Source code
Download scripts

Key takeaways

  1. A first situation map answers three questions: what happened, where, and what is in the way. Open data answers all three within hours to days: the Copernicus EMS activation, a modelled rainfall grid, municipal boundaries and OpenStreetMap facilities.
  2. Copernicus EMS was activated for Valencia 2 hours 10 minutes after the event time. The first flood delineation for L'Horta Sud arrived 84.2 hours after it, from WorldView-2 imagery of 31 October, and mapped 24.1 km² of flood extent.
  3. Most of that extent (23.23 km²) is flood trace, not standing water (0.84 km²). Two days after a flash flood, the water has gone and the mud remains, so read the notation field before you report a number.
  4. A 9 km weather model gives the pattern and timing of rain, not the peak. ECMWF IFS gives 127.8 mm at Turís on 29 October; the AEMET gauge there recorded 771 l/m² in 24 hours.
  5. Query OpenStreetMap as it was before the event with an Overpass attic date. Inside the mapped area, 24 of 208 schools, 2 of 54 health facilities, 1 of 39 fire and police stations and 88 of 288 road bridges were in the flood extent.
  6. Only count exposure inside the area that was actually mapped. Outside the EMS area of interest, 'no water' means 'not mapped', not 'dry'.

Before you start

  • Basic Python and a first look at GeoPandas (reading files, plotting, spatial joins)
  • Python 3.10+ with geopandas, osmnx, folium, matplotlib and requests
  • An internet connection: the first run downloads about 61 MB from Copernicus EMS, geoBoundaries, Open-Meteo and the Overpass API and takes 3 to 10 minutes, depending on how busy the public Overpass server is

Short answer: a first situation map combines four kinds of open data that you can fetch from Python within hours of a disaster: the official event footprint (here the Copernicus EMS rapid mapping activation and its first flood delineation), administrative units (municipalities), the hazard driver (modelled rainfall) and what is exposed (hospitals, schools, emergency stations and bridges from OpenStreetMap, queried as they were before the event). Overlay them, count what falls inside the mapped flood extent, stamp the map with the time the information refers to, and summarise it in a short “what we know” table:

flood = read_ems("AOI03", "observedEventA") # Copernicus EMS first delineation
fac["in_flood"] = fac.intersects(flood.union_all()) # OpenStreetMap facilities, as of 29 Oct
fac.groupby("facility")["in_flood"].agg(total="size", in_flood="sum")

For the Valencia floods of 29 October 2024, the first Copernicus EMS delineation for L’Horta Sud mapped 24.1 km² of flood extent. Inside the mapped area, 24 of 208 schools, 2 of 54 health facilities and 88 of 288 road bridges were in it, and the worst-hit municipalities by area were Quart de Poblet, Riba-roja de Túria and Torrent.

On 29 October 2024 an isolated upper-level low, a DANA, stalled over eastern Spain. Rain of extraordinary intensity fell on the hills west of Valencia, and the Poyo ravine and other watercourses carried it as a flash flood into the dense towns of L’Horta Sud in the evening. The Spanish Government’s follow-up figures of 24 November 2024 record that more than 220 people died in the Comunitat Valenciana.

This is Part 1 of GIS for disaster emergency response, a six-part series that follows one event through the response lifecycle, written for GIS analysts who support civil protection, NGOs and local government. Part 1 builds the first situation map from open data. Part 2 maps the flood extent yourself from Sentinel-1 radar and Sentinel-2 optical imagery and measures how well it agrees with the Copernicus EMS product. Part 3 estimates the buildings and people exposed. Part 4 works out which roads, hospitals and neighbourhoods were cut off and where to put relief points. Part 5 builds a field survey for teams on the ground, and Part 6 packages the results for responders as files, a dashboard and a print-ready map.

You will learn how to:

  • read a Copernicus EMS activation and its product timeline from the public API, and download a flood delineation as vector data;
  • tell flood trace from flooded area, and a very high resolution delineation from a Sentinel-2 one;
  • get municipal boundaries for Spain from geoBoundaries;
  • pull modelled hourly rainfall for any point from the Open-Meteo archive, and know what it can and cannot tell you;
  • query OpenStreetMap as it was before the event with an Overpass attic date, through OSMnx and directly;
  • count facilities and bridges in the flood extent only where the extent was mapped;
  • make a one-page situation map, an interactive Folium map and a “what we know” table with sources and times.

All outputs below are real results from situation_map.py, run on 17 November 2026 with Python 3.12, geopandas 1.2.0, osmnx 2.1.2 and folium 1.0.0.

What a first situation map is for

In the first hours of a disaster, responders need a shared picture: where the event is, which places are affected, and which hospitals, schools, stations and bridges are in the way. It does not need to be perfect. It needs to be sourced and dated, so everyone knows what each number means and how old it is.

Everything here is open and needs no account or key. The trade-off is time: each source arrives at its own pace, and the map is only as current as its oldest important layer. We will make that visible rather than hide it.

The study area is L’Horta Sud, from Torrent and Aldaia to the Albufera lagoon: longitude −0.60 to −0.30 and latitude 39.33 to 39.50, worked in ETRS89 / UTM zone 30N (EPSG:25830) for metres. It reaches 0.05° further west than a box drawn around the towns would, so that it holds the whole of the Copernicus EMS area for L’Horta Sud, including the Poyo ravine upstream of Torrent and Aldaia.

situation_map.py
BBOX = (-0.60, 39.33, -0.30, 39.50) # lon/lat: L'Horta Sud, from Torrent and Aldaia to the Albufera
CRS = "EPSG:25830" # ETRS89 / UTM zone 30N, metres
ACTIVATION = "EMSR773"
EVENT_UTC = pd.Timestamp("2024-10-29 14:30", tz="UTC")
OSM_DATE = "2024-10-29T00:00:00Z" # OpenStreetMap as it was on the morning of the flood
RAIN_BOX = (-1.0, 39.1, -0.2, 39.7) # wider window: the rain fell upstream, in the Poyo catchment

Step 1: read the Copernicus EMS activation

The Copernicus Emergency Management Service (EMS) makes maps from satellite and aerial images for authorities dealing with a disaster. Spain activated it for Valencia as EMSR773. The rapid mapping portal has a public JSON API behind it, so one request returns the whole activation: its areas of interest (AOIs), every product, the sensor and image time, and when each product was delivered.

situation_map.py
api = "https://rapidmapping.emergency.copernicus.eu/backend/dashboard-api/public-activations/"
act = requests.get(api, params={"code": ACTIVATION}, headers=UA, timeout=60).json()["results"][0]
print(f"{act['code']}: {act['name']} | {act['category']}, {len(act['aois'])} areas of interest")
print(f"event {act['eventTime']} UTC, activated {act['activationTime']} UTC by {act['activator'].split('|')[0]}")
rows = []
for aoi in act["aois"]:
footprint = wkt.loads(aoi["extent"])
for p in aoi["products"]:
img = p["images"][0] if p["images"] else {}
rows.append({"aoi": f"AOI{aoi['number']:02d}", "name": aoi["name"], "type": p["type"],
"monit": p.get("monitoringNumber") or 0, "sensor": img.get("sensorName"),
"image_utc": pd.Timestamp(img.get("acquisitionTime"), tz="UTC"),
"delivered_utc": pd.Timestamp(p["version"]["deliveryTime"], tz="UTC").floor("min"),
"zip": p.get("downloadPath"), "in_study_area": footprint.intersects(box(*BBOX))})
products = pd.DataFrame(rows)
products["hours_after_event"] = ((products.delivered_utc - EVENT_UTC).dt.total_seconds() / 3600).round(1)
local = products[products.in_study_area].sort_values("delivered_utc")
Output — EMSR773 products over L'Horta Sud
EMSR773: Flood in Valencia Region, Spain | Flood, 36 areas of interest
event 2024-10-29T14:30:00 UTC, activated 2024-10-29T16:40:00 UTC by Spain
44 products in total; 12 cover the study area:
aoi name type monit sensor image_utc delivered_utc hours_after_event
AOI03 Horta Sud DEL 0 WorldView-2 2024-10-31 10:22:00+00:00 2024-11-02 02:43:00+00:00 84.2
AOI01 Valencia province DEL 0 Sentinel-2 2024-10-31 10:51:00+00:00 2024-11-02 03:02:00+00:00 84.5
AOI01 Valencia province DEL 1 ICEYE 2024-11-03 01:51:00+00:00 2024-11-03 18:18:00+00:00 123.8
AOI03 Horta Sud GRA 0 GeoEye-1 2024-10-31 10:22:00+00:00 2024-11-06 03:36:00+00:00 181.1
AOI01 Valencia province DEL 2 Sentinel-2 2024-11-05 10:52:00+00:00 2024-11-06 07:08:00+00:00 184.6
AOI01 Valencia province DEL 3 Sentinel-1 2024-11-06 06:00:00+00:00 2024-11-06 13:10:00+00:00 190.7
AOI01 Valencia province DEL 4 COSMO-SkyMed Second Generation 2024-11-08 05:51:00+00:00 2024-11-08 10:55:00+00:00 236.4
AOI13 Monserrat GRA 0 Pleiades 2024-11-10 10:39:00+00:00 2024-11-11 23:54:00+00:00 321.4
AOI20 Montroi GRA 0 Plane Imagery 2024-11-11 10:00:00+00:00 2024-11-16 05:10:00+00:00 422.7
AOI30 Valencia Sud GRA 0 Plane Imagery 2024-11-17 13:21:00+00:00 2024-11-16 11:11:00+00:00 428.7
AOI35 Alcasser GRA 0 Plane Imagery 2024-11-17 13:21:00+00:00 2024-11-27 13:12:00+00:00 694.7
AOI36 Paterna GRA 0 Plane Imagery 2024-11-18 12:16:00+00:00 2024-11-29 09:46:00+00:00 739.3

The table is a timeline of what an analyst could know and when. The activation came 2 hours 10 minutes after the event time. The first flood outline for L’Horta Sud came 84.2 hours after it, from a WorldView-2 image taken on the morning of 31 October and delivered early on 2 November. Damage grading (GRA) followed four days later. Until 2 November, a situation map of this area could only show where the rain fell and what was there, not where the water went. That gap is why Part 2 of this series maps flood extent directly from free satellite data.

Step 2: read the first flood delineation

Each product is a zip of shapefiles. The flood polygons are in the layer ending _observedEventA, and the footprint that was mapped is in _areaOfInterestA. GeoPandas reads straight from the zip, so a small helper downloads the product once and returns any layer in metres:

situation_map.py
first = local[(local.type == "DEL") & (local.monit == 0)].set_index("aoi")
def read_ems(aoi: str, layer: str) -> gpd.GeoDataFrame:
url = first.loc[aoi, "zip"]
path = get(url, DATA / Path(url).name)
name = next(n for n in zipfile.ZipFile(path).namelist() if n.endswith(f"_{layer}_v1.shp"))
return gpd.read_file(f"zip://{path.as_posix()}!{name}").to_crs(CRS)
flood = read_ems("AOI03", "observedEventA")
aoi03 = read_ems("AOI03", "areaOfInterestA")
s2 = gpd.clip(read_ems("AOI01", "observedEventA"), aoi03)
flood["km2"] = flood.area / 1e6
print(flood.groupby(["notation", "det_method"])["km2"].agg(["count", "sum"]).round(2).to_string())
Output — first flood delineation
AOI03 Horta Sud: 242 km² mapped from WorldView-2 imagery of 31 Oct 2024 10:22 UTC
count sum
notation det_method
Flood trace Photo-interpretation 311 23.23
Flooded area Semi-automatic extraction 306 0.84
observed flood extent (flooded area + flood trace): 24.1 km²
same area in the AOI01 Sentinel-2 delineation: 51.8 km²

Read the notation column before you report a number. Only 0.84 km² was standing water when the image was taken. The other 23.23 km² is flood trace: streets, fields and yards the water had reached and left, marked by mud and debris and picked out by an analyst. A flash flood drains within hours, and the first clear image came almost two days later. For a picture of where the flood went, the trace is what you want, so the rest of this tutorial uses both classes together as the “observed flood extent”.

The province-wide Sentinel-2 delineation, clipped to the same footprint, gives 51.8 km², more than twice as much. Sentinel-2 pixels are 10 to 20 m, against about 0.5 m for WorldView-2, so its polygons are broad blobs that swallow streets and blocks, while the very high resolution product follows the streets themselves. Neither is “the truth”; they answer the question at different scales. Part 2 compares flood maps like these properly, with an agreement matrix.

Two maps of the same area west and south of Valencia, with municipal boundaries and a dashed AOI03 outline. On the left, the AOI03 delineation shows 24.1 km² of detailed, fine-grained blue flood trace along the Poyo ravine and through the towns. On the right, the Sentinel-2 delineation shows 51.8 km² of broader green patches over the same area.
The first Copernicus EMS flood delineations over L'Horta Sud, both from images of 31 October 2024: very high resolution imagery for AOI03 (left, 24.1 km²) and Sentinel-2 for the whole province (right, 51.8 km² inside AOI03). Darker shading is standing water; lighter shading is flood trace.

Step 3: add municipalities

Responders organise by municipality, so every number needs a municipality next to it. geoBoundaries publishes Spain’s municipal boundaries (ADM3, from the national mapping agency IGN) as one GeoJSON under CC BY 4.0. We pin a specific commit so the file does not change under us, read only the window we need with bbox=, and record how much of each municipality lies inside AOI03, because that is the only part we can say anything about:

situation_map.py
gb = get("https://github.com/wmgeolab/geoBoundaries/raw/9469f09/releaseData/gbOpen/ESP/ADM3/"
"geoBoundaries-ESP-ADM3_simplified.geojson", DATA / "geoBoundaries-ESP-ADM3_simplified.geojson")
muni_all = gpd.read_file(gb, bbox=RAIN_BOX).to_crs(CRS)[["shapeName", "geometry"]]
muni_all = muni_all.rename(columns={"shapeName": "municipality"})
muni = muni_all[muni_all.intersects(study.geometry[0])].copy()
muni["mapped_km2"] = muni.intersection(aoi03.union_all()).area / 1e6 # area the EMS mapped
Output — municipalities
133 municipalities in the rainfall window, 33 touch the study area

Step 4: add rainfall for 29 October

Most of the water that flooded L’Horta Sud fell upstream, in the hills drained by the Poyo ravine. To show that, we need rainfall over a wider window than the study area. Two things matter in the first hours: where the rain fell and when.

The Open-Meteo historical weather API serves hourly archives of several models, with no key, under CC BY 4.0. We ask for the ECMWF IFS model at 9 km on a 0.1° grid of 63 points, and for hourly rain at three places: Chiva and Turís in the hills where the rain fell, and Paiporta on the plain where the Poyo ravine broke through. For comparison, we also ask for the coarser ERA5 reanalysis at about 25 km.

situation_map.py
ARCHIVE = "https://archive-api.open-meteo.com/v1/archive"
lons = np.round(np.arange(RAIN_BOX[0], RAIN_BOX[2] + 0.01, 0.1), 2)
lats = np.round(np.arange(RAIN_BOX[1], RAIN_BOX[3] + 0.01, 0.1), 2)
LON, LAT = np.meshgrid(lons, lats)
grid = requests.get(ARCHIVE, headers=UA, timeout=120, params={
"latitude": ",".join(map(str, LAT.ravel())), "longitude": ",".join(map(str, LON.ravel())),
"start_date": "2024-10-29", "end_date": "2024-10-29", "daily": "precipitation_sum",
"models": "ecmwf_ifs", "timezone": "Europe/Madrid"}).json()
rain = np.array([g["daily"]["precipitation_sum"][0] for g in grid]).reshape(LAT.shape)
pts = requests.get(ARCHIVE, headers=UA, timeout=120, params={
"latitude": ",".join(str(v[1]) for v in PLACES.values()),
"longitude": ",".join(str(v[0]) for v in PLACES.values()),
"start_date": "2024-10-29", "end_date": "2024-10-30", "hourly": "precipitation",
"daily": "precipitation_sum", "models": "ecmwf_ifs,era5", "timezone": "Europe/Madrid"}).json()
Output — rainfall, 29 October 2024
63 grid points, 0.1° spacing; 29 Oct total 28-193 mm, maximum at -0.9°, 39.1°
Chiva IFS 114.2 mm | ERA5 87.2 mm | wettest hour 19:00 local, 13.7 mm
Turís IFS 127.8 mm | ERA5 87.2 mm | wettest hour 18:00 local, 18.2 mm
Paiporta IFS 111.5 mm | ERA5 66.6 mm | wettest hour 13:00 local, 16.4 mm
Left: a map of a 0.1-degree rainfall grid west of Valencia, shaded from pale to dark blue, with municipal outlines, the red study-area box, the Rambla de Poio line running from the hills to the plain and labelled points at Chiva, Turís and Paiporta; the wettest cells are to the south-west. Right: hourly rainfall step lines from 06:00 on 29 October to 06:00 on 30 October; Paiporta peaks at midday and Turís and Chiva peak in the early evening.
Modelled rainfall on 29 October 2024 from the ECMWF IFS 9 km archive via Open-Meteo: the daily total (left) and hourly rain at three places (right). The model puts the heaviest rain in the hills west of the study area, upstream along the Poyo ravine, with the peak there in the early evening.

The pattern is right: the heaviest rain fell inland, west and south-west of the towns that flooded, and the hills had their wettest hours in the early evening. The amounts are not. The AEMET weather station at Turís recorded 771 l/m² in 24 hours, 185 of them in a single hour, a Spanish record for one hour. The model gives 127.8 mm for the whole day there, and its wettest hour is 18.2 mm. A 9 km grid cell averages the rain over 81 km², so a storm only a few kilometres across is smeared out; ERA5, at about 25 km, smooths it even more.

Step 5: get critical facilities from OpenStreetMap, as they were on the morning of the flood

OpenStreetMap is the richest open source of hospitals, schools, emergency stations and bridges, and after a disaster volunteers edit it intensively. That is good for the response, but it means today’s data is not what the map looked like on the day. The Overpass API can answer attic queries: add a [date:...] setting and it returns the data as it was at that moment. OSMnx passes it through if you set it in overpass_settings:

situation_map.py
ox.settings.use_cache = True
ox.settings.cache_folder = str(DATA / "osm_cache")
ox.settings.requests_timeout = 300
ox.settings.overpass_settings = f'[out:json][timeout:{{timeout}}][date:"{OSM_DATE}"]{{maxsize}}'
fac = osm({"amenity": ["hospital", "clinic", "school", "fire_station", "police"],
"healthcare": ["hospital", "centre"], "emergency": ["ambulance_station"]}).reset_index()
# "facility", not "type": GeoDataFrame.type is a built-in property that returns geometry types
fac["facility"] = fac.apply(facility_type, axis=1)

Here osm() wraps ox.features.features_from_bbox with a polite retry, because the public Overpass server is often busy, and facility_type() turns the tags into six readable classes. Name the column facility, not type: GeoDataFrame.type already exists and returns the geometry type, so fac.type would quietly give you “Point” and “Polygon”.

For roads, bridges, railways and rivers we send one raw Overpass query and ask for way geometries directly with out tags geom. It is lighter on the server than asking OSMnx for every feature that carries any of these tags. A road bridge is any vehicle road way tagged bridge=yes or bridge=viaduct:

situation_map.py
VEHICLE = "motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|service"
s, w, n, e = BBOX[1], BBOX[0], BBOX[3], BBOX[2]
query = f"""[out:json][timeout:600][date:"{OSM_DATE}"];
(way["highway"~"^(motorway|trunk|primary|secondary)(_link)?$"]({s},{w},{n},{e});
way["bridge"~"^(yes|viaduct)$"]["highway"~"^({VEHICLE})(_link)?$"]({s},{w},{n},{e});
way["railway"="rail"]({s},{w},{n},{e});
way["waterway"~"^(river|canal|stream)$"]({s},{w},{n},{e}););
out tags geom;"""
r = requests.post("https://overpass-api.de/api/interpreter", data={"data": query}, headers=UA, timeout=700)
Output — OpenStreetMap features (as of 29 Oct 2024 00:00 UTC)
571 facilities in the study area: School 376, Health centre 100, Police 57, Hospital 24, Fire station 11, Ambulance station 3
3769 major road ways, 572 rail ways, 391 waterways, 487 road bridges
Poyo ravine in OSM: Rambla de Poio, 1 way, 15.3 km in the study area

The last line is a small lesson in itself. On the morning of the flood, OpenStreetMap named only one way of the Poyo ravine, as “Rambla de Poio”, 15.3 km from Riba-roja to Picanya. Downstream, through Paiporta, the channel had no name. A search for “Poyo” alone would have missed it, and a search by name finds nothing in the town where the flood was worst. Check names in both local languages (Valencian Poio, Spanish Poyo) and look at the geometry, not just the attributes.

Step 6: what is in the flood?

Now the overlay. One rule matters more than any other: only count inside the area that was mapped. AOI03 covers 242 km². Outside it, a school with no flood polygon around it is not “dry”; nobody looked. So we keep only the facilities and bridges inside AOI03, then test each against the dissolved flood extent:

situation_map.py
# Only the area inside AOI03 was mapped. Outside it, "no water" means "not mapped", not "dry".
mapped = aoi03.union_all()
fac = fac[fac.intersects(mapped)].copy()
bridges = bridges[bridges.intersects(mapped)].copy()
extent = flood.dissolve()[["geometry"]]
fac["in_flood"] = fac.intersects(extent.geometry[0])
bridges["in_flood"] = bridges.intersects(extent.geometry[0])
bridges["over_poyo"] = bridges.intersects(poyo.union_all().buffer(5))
fac = gpd.sjoin(fac, muni[["municipality", "geometry"]], how="left", predicate="intersects") \
.drop_duplicates(["element", "id"]).drop(columns="index_right")
by_type = fac.groupby("facility")["in_flood"].agg(total="size", in_flood="sum")
Output — exposure to the first delineation
inside AOI03: 301 facilities and 288 road bridges
total in_flood
facility
School 208 24
Health centre 43 1
Police 32 0
Hospital 11 1
Fire station 7 1
road bridges in the flood extent: 88 of 288; road bridges over the Poyo ravine: 11
Facilities inside the flood extent (excluding schools):
facility name municipality
Fire station Parc de Bombers de Torrent Torrent
Health centre Centre de Salut d'Alaquàs Alaquàs
Hospital (no name in OSM) Catarroja

Facilities are points or building outlines, so intersects counts a school whose grounds touch the flood extent, not only one whose centre is under water. That suits a first screening: it errs towards including places someone should check. The ambulance stations in the study area all lie outside AOI03, so they drop out of the table. The hospital in Catarroja has no name in OpenStreetMap; in a real response, that is the kind of gap you would fix in OSM or note on the map.

Then the same counts per municipality. mapped_km2 is the part of each municipality inside AOI03, and flood_pct is the share of that part in the flood extent:

situation_map.py
fl_muni = gpd.overlay(flood[["geometry"]], muni[["municipality", "geometry"]], how="intersection")
summary = muni.set_index("municipality")[["mapped_km2"]].copy()
fl_muni["km2"] = fl_muni.area / 1e6
summary["flood_km2"] = fl_muni.groupby("municipality")["km2"].sum()
summary["facilities"] = fac.groupby("municipality").size()
summary["facilities_in_flood"] = fac[fac.in_flood].groupby("municipality").size()
summary["bridges_in_flood"] = bridges[bridges.in_flood].groupby("municipality").size()
summary = summary.fillna(0)
summary["flood_pct"] = 100 * summary.flood_km2 / summary.mapped_km2
summary = summary[summary.flood_km2 >= 0.05].sort_values("flood_km2", ascending=False)
Output — municipalities in the flood extent
20 municipalities with at least 5 ha in the flood extent (flood_pct = share of the mapped part):
mapped_km2 flood_km2 facilities facilities_in_flood bridges_in_flood flood_pct
municipality
Quart de Poblet 19.7 4.20 12 1 11 21.3
Riba-roja de Túria 10.2 3.96 0 0 15 38.8
Torrent 62.9 2.85 46 2 18 4.5
Aldaia 15.9 2.83 29 6 9 17.7
València 17.1 2.04 92 0 7 11.9
Chiva 14.0 1.86 0 0 1 13.3
Paiporta 3.9 1.69 4 2 1 43.3
Albal 6.6 0.99 9 2 0 14.9
Loriguilla 4.3 0.61 2 0 1 14.4
Catarroja 6.7 0.61 14 7 2 9.1
Silla 7.1 0.48 12 0 1 6.8
Picanya 7.3 0.39 7 0 12 5.4
Beniparrell 3.6 0.37 0 0 2 10.3
Massanassa 1.2 0.27 4 3 1 21.5
Xirivella 5.2 0.22 14 0 2 4.3
Alfafar 0.9 0.21 3 2 0 22.6
Alcàsser 9.0 0.13 5 0 0 1.4
Alaquàs 3.8 0.13 18 1 5 3.3
Manises 7.9 0.12 7 0 0 1.5
Benetússer 0.8 0.06 5 1 0 8.0

Area and impact rank differently. Quart de Poblet and Riba-roja de Túria top the list by area. Paiporta has only 1.69 km² in the extent, but that is 43.3% of its mapped area, and it is dense housing. Catarroja has 7 facilities in the flood extent, the most of any municipality, and Picanya has 12 road bridges in it, where the ravine runs through the town. A situation map should show all three views: area, share and what is exposed.

Horizontal bar chart of flood extent in square kilometres for 15 municipalities, from Quart de Poblet (4.2) and Riba-roja de Túria (4.0) at the top down to Xirivella. Each bar is labelled with the percentage of the mapped area flooded, facilities in the flood and road bridges in the flood; Paiporta reads 43% of mapped area.
Flood extent by municipality in the first EMS delineation for AOI03, with the share of each municipality's mapped area, the facilities in the flood extent out of those inside AOI03, and the road bridges in the flood extent.

Step 7: write the “what we know” table

The last analysis step turns all of this into eight lines that someone can read out at a coordination meeting. Every line has a source and an as of time, because the layers are not equally fresh: the facilities are from the morning of 29 October, the flood extent from an image of 31 October, and the product was delivered on 2 November.

situation_map.py
know = pd.DataFrame([
("Event", f"Extraordinary rainfall from {EVENT_UTC:%d %b %Y %H:%M} UTC", "Copernicus EMS EMSR773",
f"{pd.Timestamp(act['activationTime']):%d %b %H:%M} UTC"),
("Flood extent", f"{flood.km2.sum():.1f} km² in L'Horta Sud", "EMS AOI03 first delineation",
f"image {aoi03_row.image_utc:%d %b %H:%M} UTC"),
("Road bridges", f"{bridges.in_flood.sum()} in the flood extent, {bridges.over_poyo.sum()} over the Poyo ravine",
"OSM + EMS", "OSM 29 Oct"),
# ... rainfall, municipalities, health facilities, schools and emergency services in the full script
], columns=["topic", "what we know", "source", "as of"])
know.to_csv(OUT / "what_we_know.csv", index=False)
Output — what we know
topic what we know source as of
Event Extraordinary rainfall from 29 Oct 2024 14:30 UTC Copernicus EMS EMSR773 29 Oct 16:40 UTC
Rainfall, 29 Oct up to 193 mm (ECMWF IFS 9 km, max of 63 grid points); Chiva 114 mm, Paiporta 112 mm Open-Meteo 29 Oct (local day)
Flood extent 24.1 km² in L'Horta Sud EMS AOI03 first delineation image 31 Oct 10:22 UTC
Municipalities 20 with ≥5 ha flooded; most: Quart de Poblet, Riba-roja de Túria, Torrent geoBoundaries + EMS 02 Nov 02:43 UTC
Health facilities 2 of 54 in the flood extent OSM + EMS OSM 29 Oct
Schools 24 of 208 in the flood extent OSM + EMS OSM 29 Oct
Emergency services 1 of 39 stations in the flood extent OSM + EMS OSM 29 Oct
Road bridges 88 in the flood extent, 11 over the Poyo ravine OSM + EMS OSM 29 Oct
wrote situation_emsr773.gpkg (4 layers) and what_we_know.csv

The script also writes the flood extent, facilities, bridges and municipalities to one GeoPackage, situation_emsr773.gpkg, so the next analyst can open the same layers in QGIS or ArcGIS Pro without rerunning anything.

The one-page situation map

The map puts everything on one page in a fixed order, from background to foreground: municipalities, the flood extent, rivers and the Poyo ravine, major roads and railways, the AOI03 boundary, road bridges in the flood, and then the facilities. A filled symbol is a facility in the flood extent; an open one is outside it. The title carries the “information as of” time, the delivery time of the flood product, and the credit line names every source. The legend counts are the ones from Step 6, so the map and the table can never disagree.

Situation map of L'Horta Sud, south and west of Valencia, titled 'Information as of 02 Nov 2024 02:43 UTC'. Blue flood extent is concentrated around Quart de Poblet, Riba-roja de Túria and Aldaia in the north-west, follows the Rambla de Poio through Torrent and Picanya to Paiporta, and spreads south through Catarroja, Albal and Silla. Red lines mark road bridges in the flood. Filled facility symbols, mostly purple school circles, cluster in Paiporta, Catarroja and Massanassa. A legend on the right lists each facility type with how many are in the flood; a 5 km scale bar and a north arrow are shown.
The one-page situation map: the first Copernicus EMS flood delineation for L'Horta Sud with OpenStreetMap facilities and road bridges as they were on 29 October 2024. Counts in the legend are for facilities inside AOI03 only.

Step 8: an interactive map

A static map is what goes into a briefing, but analysts and coordinators want to zoom in and click. Folium writes a single HTML file with the same layers, a tooltip on every facility and bridge, and a layer switcher. Schools are switched off at first, because 208 purple dots hide everything else:

situation_map.py
m = folium.Map(location=[centre.y, centre.x], zoom_start=12, tiles="OpenStreetMap", control_scale=True)
web = flood[["notation", "geometry"]].copy()
web["geometry"] = web.simplify(3)
folium.GeoJson(web.to_crs(4326), name="Flood extent, 31 Oct (Copernicus EMS)",
style_function=lambda f: {"color": "#1f5fa8", "weight": 0, "fillColor": "#3d8fd1",
"fillOpacity": 0.6 if f["properties"]["notation"] == "Flooded area" else 0.35},
tooltip=folium.GeoJsonTooltip(["notation"], labels=False)).add_to(m)
for t, (_, c, _) in STYLE.items():
layer = folium.FeatureGroup(name=f"{t} (OSM)", show=t != "School")
# one CircleMarker per facility: larger with a black outline when it is in the flood extent
layer.add_to(m)
folium.LayerControl(collapsed=False).add_to(m)
html = OUT / "situation_map.html"
m.save(html)
Output — interactive map
wrote situation_map.html: 1.43 MB

Simplifying the flood polygons by 3 m keeps their shape and the file small enough to share by email or a messaging app.

Live Folium output from the script. Toggle layers on the right; hover over a facility or bridge for its name. Tiles © OpenStreetMap contributors. Open full screen ↗

Limitations and how to improve them

  • The flood extent is days old. It shows where water had been by 31 October, not the peak on the evening of 29 October; later monitoring products and Part 2’s satellite methods add to it.
  • Modelled rain underestimates the peak by a factor of about six at Turís; add AEMET station data or radar for amounts.
  • OpenStreetMap completeness varies. Some facilities are missing or unnamed; check the key ones against official registers such as the regional health and education directories.
  • Intersects is generous. A large school site touching the extent counts as in it; for building-level exposure, Part 3 uses building footprints.

Frequently asked questions

How quickly does Copernicus EMS deliver maps after a disaster?

It depends first on getting a usable image: satellite passes, cloud and the size of the area all add time before mapping can start. For EMSR773 the activation came 2 hours 10 minutes after the event time; the first usable image of L’Horta Sud was taken on 31 October, and its delineation was delivered 84.2 hours after the event. Read the timeline from the API, as in Step 1, so you know what exists for your area and when.

What is the difference between flooded area and flood trace?

Flooded area is standing water visible in the image. Flood trace is land the water reached but had left by the time of the image, recognised by mud, debris and wet surfaces. In the first AOI03 delineation, 0.84 km² was flooded area and 23.23 km² was flood trace.

Who can activate Copernicus EMS, and can anyone download the data?

Activations are requested by authorised users, mainly national civil protection authorities and EU bodies. The products are free for anyone to download and reuse under the Copernicus EMS terms, with the source credited.

Why query OpenStreetMap as it was before the event?

After a disaster, volunteers map damage, closures and new facilities quickly. That helps the response, but the current data then mixes the pre-event state with changes caused by the event. An Overpass attic date such as [date:"2024-10-29T00:00:00Z"] gives you a consistent baseline of what was there before.

Can I use ERA5 or Open-Meteo rainfall to say how much rain fell?

Use them for where and when it rained, not for peak amounts. In this case the ECMWF IFS 9 km archive gave 127.8 mm at Turís on 29 October and ERA5 gave 87.2 mm, while the AEMET station there recorded 771 l/m² in 24 hours. Gridded data averages rain over whole cells, so small, intense storms are smoothed out.

Can I run this for another disaster?

Yes. Change the activation code, the bounding box, the event time, the OSM date and the rainfall window in the settings block. The EMS API, Open-Meteo, Overpass and geoBoundaries all work worldwide; only the layer names inside EMS products and the facility tags may need a check.

Next steps

Data and licences

  • Copernicus EMS rapid mapping, activation EMSR773: product timeline and the first delineation products for AOI03 (Horta Sud) and AOI01 (Valencia province), from the rapid mapping portal and its public API, accessed on 17 November 2026. © European Union, Copernicus Emergency Management Service. Free, full and open access under Regulation (EU) 2021/696 and the Copernicus EMS terms and conditions.
  • Municipalities: geoBoundaries, Spain ADM3, simplified, from data of the Instituto Geográfico Nacional (IGN), via GitHub at commit 9469f09, accessed on 17 November 2026. Licensed CC BY 4.0. Runfola, D. et al. (2020), “geoBoundaries: A global database of political administrative boundaries”, PLoS ONE 15(4): e0231866.
  • Rainfall: ECMWF IFS 9 km and ERA5 archives from the Open-Meteo historical weather API, accessed on 17 November 2026. Weather data by Open-Meteo.com, licensed CC BY 4.0; contains modified Copernicus Climate Change Service information (ERA5) and ECMWF data.
  • Station rainfall quoted for comparison: Agencia Estatal de Meteorología (AEMET), October 2024 climate summary and report on the DANA episode of 29 October 2024.
  • Facilities, roads, bridges, railways and rivers: © OpenStreetMap contributors, available under the Open Database Licence, as of 29 October 2024 00:00 UTC, through the Overpass API (overpass-api.de) and OSMnx, accessed on 17 November 2026. Map tiles in the interactive map © OpenStreetMap contributors.
  • Casualty figures: Government of Spain, La Moncloa, DANA follow-up data, 24 November 2024.
  • Code: situation_map.py, tested with Python 3.12.0, geopandas 1.2.0, osmnx 2.1.2, folium 1.0.0, matplotlib 3.11.2, pandas 3.1.1, numpy 2.5.5, shapely 2.2.0, pyproj 3.8.0, pyogrio 0.13.0 and requests 2.34.2.

Key terms

DANA
Depresión aislada en niveles altos, an isolated upper-level low (a cut-off low). A pool of cold air aloft, cut off from the main jet stream, that can sit over warm Mediterranean water and fuel slow-moving, extremely heavy rain in autumn.
Copernicus EMS Rapid Mapping
The on-demand mapping component of the Copernicus Emergency Management Service. An authorised user, usually a national civil protection authority, activates it, and it delivers satellite-based maps and vector data within hours to days, free of charge.
Activation
A request to Copernicus EMS for one event, with a code such as EMSR773. It holds one or more areas of interest, each with its own products.
Area of interest (AOI)
The footprint that one Copernicus EMS product covers. Data outside it was not mapped, which is different from data showing no flooding.
Delineation (DEL)
A Copernicus EMS product that outlines the extent of the event, here the flood, from one satellite or aerial image. Monitoring products repeat it with later images.
Grading (GRA)
A Copernicus EMS product that assesses the damage to buildings, roads and other assets, usually from very high resolution imagery.
Flood trace
Land the water reached but has since left, recognised by mud, debris and wet surfaces. Copernicus EMS maps it separately from flooded area, which is standing water at the time of the image.
Overpass attic query
An Overpass API query with a date setting, such as [date:"2024-10-29T00:00:00Z"], that returns OpenStreetMap as it was at that moment, before any edits made after the event.
Situation map
A map that shows the current known state of an emergency for the people responding to it, with the time the information refers to and its sources.
Four panels showing how Voronoi polygons are built for 47 rain gauges around the River Eden catchment: the gauges and the catchment outline, their Delaunay triangulation, the triangle circumcentres joined into red Voronoi edges, and the cells clipped to the catchment and shaded by each gauge's rainfall.

Tutorial Python

Voronoi (Thiessen) polygons in Python: catchment rainfall from EA rain gauges and fire station areas in Cumbria

Build Voronoi (Thiessen) polygons in Python with shapely and GeoPandas, clipped to a real boundary. Compute Thiessen-weighted catchment rainfall for the River Eden from Environment Agency rain gauge readings, check the gauges, compare with the gauge average and IDW, then compare Voronoi 'nearest fire station' areas in Cumbria with drive-time service areas from OpenStreetMap.

Intermediate 15 min read

Two maps of walking time from Pen-y-Pass on Yr Wyddfa, shaded purple to red with 30-minute contours, comparing isotropic and slope-aware cost

Tutorial Python

Least-cost path analysis in Python: cost surfaces and walking routes up Yr Wyddfa

Build a walking cost surface from real slope (Copernicus GLO-30) and land cover (ESA WorldCover), compute the accumulated cost surface and the least-cost path with scikit-image's MCP_Geometric, add a direction-aware Dijkstra version with SciPy, and compare the routes with the straight line and the OpenStreetMap footpaths from Pen-y-Pass to the summit of Yr Wyddfa (Snowdon).

Intermediate 14 min read

Chart of cumulative geocoding error on a log distance scale for five methods, with name search and the combined rule most accurate

Tutorial Python

Geocoding in Python: batch and reverse geocoding with geopy, Nominatim and postcodes.io

Batch geocode all 192 open schools in Sheffield in Python with geopy and OpenStreetMap Nominatim (1 request per second, a custom user agent and an on-disk cache) and with postcodes.io bulk postcode lookups, reverse geocode a sample, and measure every method honestly against the Department for Education's own coordinates. Covers free text against structured queries, failure modes, cross-checking two geocoders, and the licensing of geocoded results.

Beginner 14 min read