
Flooding is one of the most disruptive natural disasters affecting transportation infrastructure worldwide. When heavy rainfall causes rivers to overflow or urban drainage systems to fail, roads can become inaccessible within hours. Emergency responders, logistics companies, and local authorities need reliable information about potentially affected routes, but physically inspecting every road during a flood is often impractical. Satellite imagery provides an alternative by allowing analysts to observe large geographic areas and identify possible floodwater coverage without sending inspection teams into dangerous conditions.
By combining satellite observations with Python and Geographic Information Systems (GIS), developers can create automated workflows that identify road segments intersecting satellite-derived flood zones. This approach is particularly valuable for disaster response, infrastructure monitoring, and transportation planning. In this tutorial, we'll explore how Synthetic Aperture Radar (SAR) imagery supports flood detection, how geospatial Python libraries process satellite-derived flood maps, and how developers can identify potentially affected roads using publicly available geographic datasets.
Why Satellite Imagery Is Useful for Flood Detection
Traditional flood monitoring relies on rainfall measurements, river gauges, field inspections, and hydrological models. Although these methods provide valuable information, they may not reveal the complete geographical extent of flooding, especially across remote regions or large metropolitan areas. Satellite imagery complements these monitoring systems by providing observations of extensive areas from space.
Optical satellites, including the Sentinel-2 constellation, capture reflected sunlight and can help distinguish water from vegetation, buildings, and exposed ground. However, optical imagery becomes less useful when clouds obscure the Earth's surface, a common problem during severe storms. Synthetic Aperture Radar satellites address this limitation by transmitting microwave signals and measuring the reflected energy. Radar can collect observations during the day or night and through cloud cover, making it especially useful for flood monitoring.
The European Space Agency's Sentinel-1 mission is a widely used source of radar observations. Analysts can compare images acquired before and after a flood to detect changes in surface conditions. Smooth open water often reflects radar energy away from the sensor, producing relatively low backscatter values. By identifying areas where backscatter decreases significantly, analysts can locate possible newly inundated surfaces. However, radar responses are influenced by vegetation, buildings, wind, surface roughness, and acquisition geometry, so a backscatter change alone does not establish that flooding occurred.
Understanding the Flooded-Road Detection Process
The fundamental concept is straightforward: first identify potentially flooded areas using satellite observations, then determine which road segments overlap those areas. A practical workflow consists of obtaining satellite data, processing the imagery into a flood classification raster, loading a road network, performing a spatial intersection, and exporting the potentially affected roads for visualization or further analysis.
For this tutorial, we'll assume that satellite processing has already produced a georeferenced binary flood raster named flood_mask.tif. In this raster, a value of 1 indicates a pixel classified as potentially flooded, while 0 represents a non-flooded pixel. Missing observations should be represented using a separate NoData value. We'll combine this raster with a road network stored in roads.geojson. The road network could come from OpenStreetMap or an authorized government GIS dataset.
This distinction matters because identifying flooded land is not the same as proving that a road is impassable. A road may cross a flood polygon while remaining above the water on a bridge or embankment. Similarly, a narrow flooded road may not be detected by a satellite sensor whose spatial resolution is coarser than the road width. Our output will therefore identify potentially flood-exposed road segments, not confirmed road closures.
Step 1: Install the Required Python Libraries
We'll use Rasterio to read satellite-derived raster data, GeoPandas to manage road geometries, Shapely for spatial operations, NumPy for array processing, and Matplotlib for visualization. Install the libraries using the following command:
pip install rasterio geopandas shapely numpy matplotlib
These libraries provide the basic tools required to combine raster and vector geospatial datasets. Rasterio preserves important geographic metadata, including coordinate reference systems and pixel transformations. GeoPandas supports spatial filtering, geometry operations, and exporting GIS-compatible datasets. Shapely allows us to calculate intersections between road geometries and flood polygons.
Step 2: Load the Satellite-Derived Flood Raster
Begin by opening the flood raster and reading its first band. We'll also preserve the raster's coordinate reference system and affine transformation, which describe where the pixels are located geographically.
import rasterio
import numpy as np
with rasterio.open("flood_mask.tif") as src:
flood_data = src.read(1, masked=True)
transform = src.transform
raster_crs = src.crs
valid_pixels = ~np.ma.getmaskarray(flood_data)
flood_pixels = (
(np.ma.getdata(flood_data) == 1)
& valid_pixels
)
print("Flood raster loaded")
print("Raster shape:", flood_data.shape)
print("Potential flood pixels:", flood_pixels.sum())
The code creates a Boolean array identifying pixels classified as potentially flooded. Importantly, masked or missing pixels are excluded rather than incorrectly interpreted as non-flooded. The raster must already have been processed and classified; this example does not perform raw SAR calibration, terrain correction, speckle filtering, or flood classification.
For real-world applications, those preprocessing stages are essential. Radar datasets should be processed consistently, and classification thresholds should be calibrated and validated for the geographic region and environmental conditions.
Step 3: Convert Flood Pixels Into Geographic Polygons
To compare the flood raster with road geometries, we'll convert the classified pixels into vector polygons. Rasterio provides a convenient function called features.shapes() that extracts polygon boundaries from raster regions.
from rasterio.features import shapes
from shapely.geometry import shape
import geopandas as gpd
flood_geometries = []
for geometry, value in shapes(
flood_pixels.astype("uint8"),
mask=flood_pixels,
transform=transform
):
if value == 1:
flood_geometries.append(shape(geometry))
flood_gdf = gpd.GeoDataFrame(
geometry=flood_geometries,
crs=raster_crs
)
print("Flood polygons:", len(flood_gdf))
Each polygon represents a connected region classified as potential floodwater. Depending on the size of the study area and the complexity of the flood pattern, the resulting dataset may contain hundreds or thousands of polygons. For large raster datasets, polygonization can become computationally expensive, so production systems may benefit from spatial tiling, raster-based overlays, or cloud processing.
Step 4: Load the Road Network
Next, load the road network and ensure that it uses the same coordinate reference system as the flood polygons. Coordinate reference systems are critical in geospatial analysis because two datasets can describe the same location using completely different numerical coordinates.
roads = gpd.read_file("roads.geojson")
roads = roads[
roads.geometry.notna()
& ~roads.geometry.is_empty
].copy()
roads = roads[
roads.geometry.geom_type.isin(
["LineString", "MultiLineString"]
)
]
if roads.crs is None or flood_gdf.crs is None:
raise ValueError("Both datasets require a valid CRS.")
roads = roads.to_crs(flood_gdf.crs)
print("Road segments loaded:", len(roads))
At this stage, the road network and flood polygons share a coordinate system, allowing meaningful spatial operations. Before performing the analysis, it's also worth checking the quality and completeness of the road dataset. OpenStreetMap coverage varies by location, and missing roads can produce incomplete flood-exposure estimates.
Step 5: Identify Potentially Flooded Road Segments
Now we'll perform a spatial overlay to extract the portions of roads that intersect the classified flood polygons. Rather than simply marking an entire road as flooded whenever any part intersects water, this approach calculates the actual intersecting geometry.
if flood_gdf.empty:
print("No potential flood regions detected.")
flooded_roads = roads.iloc[0:0].copy()
else:
flood_union = flood_gdf.geometry.union_all()
candidates = roads[
roads.geometry.intersects(flood_union)
].copy()
candidates["geometry"] = (
candidates.geometry.intersection(flood_union)
)
flooded_roads = candidates.explode(
index_parts=False
)
flooded_roads = flooded_roads[
~flooded_roads.geometry.is_empty
& flooded_roads.geometry.geom_type.isin(
["LineString", "MultiLineString"]
)
].copy()
print(
"Potentially affected road portions:",
len(flooded_roads)
)
This code identifies road portions overlapping the satellite-derived flood classification. It does not determine water depth, traffic accessibility, or whether a bridge remains operational. Those questions require additional information such as elevation models, road engineering data, hydrological observations, and field verification.
For a small study area, this approach is relatively simple. For a citywide or national system, developers should consider spatial indexing, efficient geometry processing, and database technologies such as PostGIS to improve performance.
Step 6: Calculate the Length of Potentially Affected Roads
Once the intersecting road portions have been extracted, we can estimate their combined length. Length calculations should use an appropriate projected coordinate reference system with metric units rather than directly measuring geometries in latitude and longitude.
if not flooded_roads.empty:
metric_crs = flooded_roads.estimate_utm_crs()
if metric_crs is None:
raise ValueError(
"Unable to determine a suitable projected CRS."
)
flooded_metric = flooded_roads.to_crs(metric_crs)
flooded_metric["length_km"] = (
flooded_metric.geometry.length / 1000
)
total_length = flooded_metric["length_km"].sum()
print(
f"Potential flood-exposed road length: "
f"{total_length:.2f} km"
)
The result represents the combined length of extracted road geometries overlapping the flood mask. It is not necessarily the length of unique roads affected, because duplicate road features or overlapping flood polygons can cause double counting. In our workflow, the flood polygons were merged before intersection, which avoids duplicate counting caused by overlapping flood regions, but duplicate road records would still need to be addressed separately.
The estimated length can support preliminary infrastructure exposure assessments, particularly when combined with road classifications such as highways, primary roads, residential streets, and service roads.
Step 7: Visualize the Results
A map makes the analysis easier to interpret. We'll display the flood polygons in blue, the complete road network in gray, and the potentially affected road portions in red.
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(12, 9))
roads.plot(
ax=ax,
color="gray",
linewidth=0.6,
label="Road network"
)
if not flood_gdf.empty:
flood_gdf.plot(
ax=ax,
color="lightblue",
alpha=0.6
)
if not flooded_roads.empty:
flooded_roads.plot(
ax=ax,
color="red",
linewidth=2
)
ax.set_title(
"Potential Flood Exposure of Road Networks"
)
ax.set_axis_off()
plt.tight_layout()
plt.show()
This visualization helps identify areas where transportation infrastructure intersects potential floodwater. Analysts can enhance the map by adding administrative boundaries, hospitals, emergency shelters, bridges, and critical supply routes.
For interactive applications, the resulting data can also be displayed using Folium, Leaflet, MapLibre, or other web mapping technologies.
Step 8: Export the Results for GIS Applications
Finally, export the potentially affected road geometries to GeoJSON so they can be opened in QGIS, integrated into a web application, or shared with other geospatial analysts.
if not flooded_roads.empty:
flooded_roads.to_crs("EPSG:4326").to_file(
"potentially_flooded_roads.geojson",
driver="GeoJSON"
)
print("GeoJSON exported successfully.")
else:
print("No intersecting road portions to export.")
GeoJSON is widely supported across GIS and web mapping platforms, making it useful for transferring geographic results between different systems. However, the exported dataset should clearly identify the flood classification date, satellite acquisition time, data sources, and uncertainty. Without this metadata, users may mistakenly treat preliminary satellite observations as current and verified road conditions.
Where Can Developers Obtain Satellite Imagery?
Several public platforms provide satellite observations and geospatial datasets suitable for experimentation. The Copernicus Data Space Ecosystem offers access to Sentinel satellite data, including Sentinel-1 radar observations. Google Earth Engine provides cloud-based tools for processing large geospatial datasets, although its access and licensing conditions depend on the intended use. NASA Earthdata offers a broad collection of Earth observation products, and OpenStreetMap provides community-maintained road network information.
For developers exploring the commercial applications of Earth observation, Zam Zam Satellite's satellite imagery resources provide a starting point for understanding how satellite imagery can support infrastructure monitoring, environmental analysis, and geospatial decision-making.
The important consideration is selecting imagery with suitable spatial resolution, acquisition frequency, geographic coverage, and licensing terms for the intended application.
Challenges in Detecting Flooded Roads From Space
Although satellite-based flood mapping is powerful, several limitations must be considered before using the results operationally.
Spatial resolution: A satellite pixel may cover an area larger than an individual road. Narrow roads can be difficult to classify accurately, and mixed pixels may contain water, vegetation, and infrastructure simultaneously.
Urban radar effects: Buildings, bridges, and other structures produce complex radar reflections. In some urban environments, flooding may increase radar backscatter rather than decrease it, particularly where double-bounce scattering occurs between water and vertical structures.
Temporal differences: A satellite image represents conditions at the acquisition time. Floodwater can rise or recede rapidly, meaning a map generated from an earlier observation may not represent current road conditions.
Road elevation: A road may pass over a floodplain on a raised bridge or embankment. A two-dimensional flood intersection does not establish that water has reached the road surface.
Classification errors: Dark radar surfaces are not always water. Smooth dry surfaces, radar shadows, and other environmental conditions can create false positives. Conversely, vegetation and complex urban surfaces can hide genuine flooding.
These limitations demonstrate why satellite imagery should be combined with additional data sources rather than treated as a standalone road-closure detection system.
Improving the Workflow With Machine Learning
The basic workflow can be extended using machine learning and deep learning. Instead of relying exclusively on manually defined flood classification thresholds, developers can train models using labeled satellite observations.
For example, a convolutional neural network or a segmentation architecture such as U-Net can learn spatial patterns associated with floodwater. Models may incorporate multiple input features, including radar backscatter, optical imagery when available, terrain elevation, slope, and historical water occurrence.
A more advanced pipeline might combine Sentinel-1 observations, a digital elevation model, rainfall measurements, and road network attributes to estimate the likelihood that specific road segments are affected by flooding.
However, machine learning introduces additional challenges. Training labels must be reliable, datasets should represent diverse environmental conditions, and models need to be evaluated on geographic regions and flood events not included in training. A model that performs well in one city may not generalize to another region with different terrain, vegetation, or building characteristics.
Performance should be assessed using metrics such as precision, recall, intersection over union, and geographically independent validation. For road-level applications, evaluation should also measure how accurately the system identifies genuinely affected transportation segments.
Real-World Applications
Satellite-based road flood exposure analysis has applications beyond academic research.
Emergency management agencies can use preliminary exposure maps to identify transportation corridors requiring urgent inspection. Logistics companies can evaluate whether distribution routes may intersect flood-affected regions. Urban planners can study historical flood exposure to identify vulnerable infrastructure and support long-term adaptation planning. Insurance analysts can combine flood maps with asset locations to assess potential exposure, while humanitarian organizations can use satellite observations to prioritize field assessments in regions with limited ground information.
The same technical approach can also be adapted for other geospatial monitoring tasks. For example, satellite-derived landslide inventories can be intersected with road networks to identify potentially damaged mountain routes. Wildfire burn perimeters can be combined with transportation datasets to assess exposed infrastructure. Coastal inundation maps can help evaluate roads potentially affected by storm surge or sea-level rise.
The underlying principle remains consistent: transform Earth observation data into geographic information that can be compared with infrastructure networks.
The Future of Satellite-Based Infrastructure Monitoring
Earth observation technology is becoming increasingly important for infrastructure resilience. As satellite constellations expand and cloud computing platforms improve, developers have more opportunities to process large volumes of geospatial information and build monitoring applications.
One promising direction is the integration of satellite imagery with real-time ground observations. Radar-derived flood extent maps could be combined with rainfall sensors, river gauges, traffic reports, and verified road closure information. Such systems could provide a more complete picture than any single data source.
Another opportunity involves automated change detection. Rather than manually comparing individual satellite images, developers can build processing pipelines that identify new observations, generate updated flood classifications, and flag changes affecting critical infrastructure.
Nevertheless, satellite revisit intervals, processing latency, sensor limitations, and ground validation requirements mean that these systems should not be described as universally real-time or fully autonomous.
The greatest value comes from combining satellite observations with trustworthy local information and clearly communicating uncertainty.
Conclusion
Satellite imagery and Python provide a practical foundation for understanding how floods may affect transportation infrastructure. By combining satellite-derived flood classifications with road network geometries, developers can identify potentially exposed road segments, estimate affected lengths, and generate geographic datasets for further analysis.
The workflow demonstrated in this article is intentionally simple, but it introduces important concepts used in professional geospatial systems: raster processing, coordinate reference systems, vector intersection, spatial measurement, and GIS visualization.
For production use, the next steps would include processing raw SAR imagery, validating flood classifications, incorporating elevation and road attributes, and comparing predictions against verified ground observations.
As Earth observation technology continues to evolve, developers who understand both satellite data and geospatial programming will be well positioned to build applications supporting disaster preparedness, infrastructure resilience, and environmental monitoring.
Explore more: Learn about the applications of satellite imagery for geospatial monitoring and analysis through Zam Zam Satellite.
References and Further Reading
- Copernicus Data Space Ecosystem — Access Sentinel satellite data and Earth observation services.
- European Space Agency — Sentinel-1 — Overview of radar-based Earth observation.
- Rasterio Documentation — Python tools for reading and processing geospatial raster data.
- GeoPandas Documentation — Geospatial data analysis with Python.
- OpenStreetMap — Open geographic road and infrastructure data.
- Google Earth Engine — Cloud-based geospatial analysis platform.
Top comments (0)