How himanshu-kushwaha0/srilanka_landslide_prediction works
This is a Sri Lanka landslide susceptibility and risk-analysis toolkit with a Flask exploration app. The documented workflow processes spatial data, derives susceptibility, combines it with rainfall and historical events for risk estimates, then produces maps and charts for users to explore. The app also provides chatbot-based risk interpretation, with local and cloud LLM options. The README documents the main Scripts/ stages, but those sources were not sampled; links for that pipeline reflect documentation, while model and app connections are limited to the supplied excerpts.
Main entry points: app.py Flask application · preprocessing.py Preprocessing · landslide_model_v2_filtered.py Risk modeling · phase1_susceptibility.py Susceptibility analysis
Components 18
Spatial Analysis
- District GIS data
Preprocess_Data/Vector_Output - Preprocessing
Scripts/preprocessing.py - Susceptibility analysis
Scripts/phase1_susceptibility.py
Risk Modeling
- Susceptibility layers
- Risk modeling
APP/Prediction Script/landslide_model_v2_filtered.py - Year-wise risk outputs
- Risk map rendering
APP/Prediction Script/visualise_risk.py
Web Exploration
- Flask application
APP/landslide_app/app.py - Web interface
APP/landslide_app/templates/index.html - Map assets
APP/landslide_app/static/maps
Chatbot
- Chat widget
APP/landslide_app/templates/chatbot_advanced_widget.html - Chat integration
APP/landslide_app/chatbot_flask_integration.py - Risk-aware RAG
APP/landslide_app/chatbot_advanced.py - Chat engine
APP/landslide_app/chatbot_engine.py - LLM providers
Other components
- Analyst
- Ollama
- Cloud LLM APIs
Connections 20
- Analyst → Preprocessing: runs analysis
- District GIS data → Preprocessing: reads layers
- Preprocessing → Susceptibility analysis: creates features
- Susceptibility analysis → Susceptibility layers: writes layers
- Susceptibility layers → Risk modeling: reads susceptibility
- Risk modeling → Year-wise risk outputs: writes risk
- Year-wise risk outputs → Risk map rendering: renders maps
- Analyst → Flask application: requests views
- Flask application → Web interface: serves page
- Flask application → Susceptibility layers: reads layers
- Flask application → Year-wise risk outputs: reads results
- Flask application → Risk modeling: launches model
- Flask application → Map assets: serves maps
- Analyst → Chat widget: asks questions
- Chat widget → Chat integration: submits query
- Chat integration → Risk-aware RAG: dispatches query
- Risk-aware RAG → Chat engine: uses engine
- Chat engine → LLM providers: requests response
- LLM providers → Ollama: calls provider
- LLM providers → Cloud LLM APIs: calls provider