Check the Setup
- Python 3.10 or newer
- An internet connection
- The requests Python package
Swiss federal flood-warning map layer for checking official warning levels near mapped destinations.
Report a ProblemFrom Source to Product Signal
FOEN publishes the ch.bafu.hydroweb-warnkarte_national layer through the federal WMS. Start with a small map image; its warning colors are not direct gauge measurements.
Install the packages, then run the notebook cell.
python -m pip install requests
import requests
response = requests.get(
"https://wms.geo.admin.ch/",
params={"SERVICE": "WMS", "VERSION": "1.1.1", "REQUEST": "GetMap",
"LAYERS": "ch.bafu.hydroweb-warnkarte_national",
"STYLES": "default", "SRS": "EPSG:4326",
"BBOX": "5.9,45.8,10.6,47.9", "WIDTH": 64, "HEIGHT": 32,
"FORMAT": "image/tiff"}, timeout=25,
)
response.raise_for_status()
assert response.content[:4] in (b"II*\x00", b"MM\x00*"), "Expected GeoTIFF"
print("FOEN warning-map bytes:", len(response.content))Test a Useful Signal
Display a small official warning-map image with its source and extent.
Swiss Federal Office for the Environment is a government source. Last verified 2026-09-28. Temporal coverage: current national flood-warning map.