AFETSMART is a grid-based spatial decision support system developed for assessing, simulating, and visualizing flood risks in Istanbul. By integrating physical geography data with an optionally trained machine learning model, the system calculates granular risk scores for decision-makers and urban planners.
- Physical Data-Driven Risk Calculation: Evaluates grid-based flood risks by processing topographical and climate variables such as elevation (DEM), rainfall (CHIRPS), and land cover/imperviousness (CORINE).
- Hazard, Exposure & Vulnerability: Separates risk into logical components, utilizing reproducible equations to compute a final risk score normalized between 0 and 1.
- Scenario & Simulation Engine: Allows interactive "What If?" simulations. Users can simulate the impact of extreme rainfall or measure how infrastructure interventions (e.g., drainage upgrades, permeable surfaces) reduce the overall risk.
- Optional ML Integration: If historical flood event data (
flood_events.csv) is provided, the system trains aRandomForestclassifier to generate AI-predicted risk scores alongside the mathematical models. - Rich Visualization: Offers an interactive map with adjustable grid layers, a density heatmap, and detailed popups containing feature data for each cell.
- Backend: Python, FastAPI, GeoPandas, Rasterio, Scikit-learn. The backend dynamically parses GeoJSON and TIF layers, computes risk on the fly, and serves simulations over REST endpoints.
- Frontend: React, React-Leaflet. Provides a clean, interactive UI for toggling layers, viewing heatmaps, and running scenario adjustments via sliders.
afetsmart/
├── backend/
│ ├── data/ # Input TIFs, CSVs, and GeoJSON boundaries
│ ├── model/ # Core ML & risk calculation engine
│ ├── main.py # FastAPI endpoints
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── public/
│ ├── src/ # React components, Map, App.jsx, styles
│ └── package.json # Node dependencies
└── ... # Project summary, installation & user guides (Turkish)
Navigate to the backend directory, install requirements, and start the FastAPI server:
cd afetsmart/backend
pip install -r requirements.txt
uvicorn main:app --reloadThe API will be available at http://127.0.0.1:8000.
In a new terminal, navigate to the frontend directory, install dependencies, and start the Vite development server:
cd afetsmart/frontend
npm install
npm run devThe UI will be accessible at http://localhost:5173.
- Rainfall Scenario: Increase the rainfall factor slider in the UI to see how extreme weather dynamically alters the risk map (shifting cells from Low to Critical).
- Intervention Scenario: Simulate drainage upgrades to observe real-time risk reduction in vulnerable neighborhoods.
- Debug Mode: Enable
AFETSMART_DEBUG_STATS=1in your environment variables for detailed backend calculation logs.
- The risk categories are strictly defined by static thresholds (0.15 / 0.30 / 0.50 / 0.70) mapping to Very Low, Low, Medium, High, and Critical.
- Cells identified primarily as water bodies (e.g. >80% water fraction) are clamped to a zero risk score automatically to prevent false positives over the sea/lakes.