How amkkoussay/rain2risk works
Rain2Risk is a web-based flood-risk screening map. A user selects a location, the browser submits it to the API, the backend gathers forecast and geographic inputs, scores grid cells, and returns results for map and risk-panel display. The graph emphasizes this live workflow and the documented global terrain, land-cover, and OpenStreetMap capabilities. The sampled sources support the analysis and provider wiring shown; unsampled API and feature modules are represented only where their paths and role are supported by the tree and documented architecture.
Main entry points: global_data.py GIS orchestration · analyze.py Analysis API · app.js Map interface · main.py HTTP server
Components 23
Map experience
- Map interface
frontend/app.js - Base map tiles
- OpenStreetMap tiles
API workflow
- HTTP server
backend/main.py - Analysis API
backend/api/analyze.py - Health API
backend/api/health.py
Geographic data
- Grid builder
backend/geo/grid.py - GIS orchestration
backend/geo/global_data.py - Elevation provider
backend/geo/dem.py - Land-cover provider
backend/geo/worldcover.py - OSM provider
backend/geo/osm.py - Cell features
backend/geo/features.py - Open-Meteo elevation
- ESA WorldCover
- Overpass API
Risk analysis
- Risk scoring
backend/risk/scoring.py - Factor normalization
backend/risk/normalization.py - Weights and levels
backend/risk/thresholds.py
Weather data
- Weather API
backend/api/weather.py - Forecast client
backend/weather/client.py - Forecast parser
backend/weather/parser.py - OpenWeather
Other components
- Map user
Connections 23
- Map user → Map interface: selects location
- Map interface → HTTP server: POSTs coordinates
- HTTP server → Analysis API: dispatches analysis
- HTTP server → Health API: dispatches health check
- HTTP server → Map interface: serves interface
- Map interface → OpenStreetMap tiles: loads base tiles
- Analysis API → GIS orchestration: requests grid data
- Analysis API → Weather API: requests forecast
- Analysis API → Risk scoring: scores each cell
- GIS orchestration → Grid builder: builds cells
- GIS orchestration → Elevation provider: fetches elevations
- GIS orchestration → Land-cover provider: fetches land cover
- GIS orchestration → OSM provider: fetches map features
- GIS orchestration → Cell features: assembles cell features
- Elevation provider → Open-Meteo elevation: requests elevation
- Land-cover provider → ESA WorldCover: requests cover tiles
- OSM provider → Overpass API: queries map data
- Weather API → Forecast client: fetches forecast
- Forecast client → OpenWeather: requests forecast
- Weather API → Forecast parser: parses payload
- Risk scoring → Factor normalization: normalizes factors
- Risk scoring → Weights and levels: uses weights and levels
- Analysis API → Map interface: returns score and grid