P-SLIP (Python Soil Landslide Investigation Platform) is a complete, fast, and modern landslide susceptibility analysis tool built entirely in Python. It processes geospatial dataβincluding Digital Terrain Models (DTMs), vector polygons (study areas, land use, soil properties), and scattered time-sensitive data (e.g., rainfall)βto compute morphological parameters (slopes, curvatures, flow paths), attribute parameters, generate datasets, and perform analyses such as SLIP factor-of-safety calculations, landslide paths, and attention pixel alerts.
This tool supports forecasting soil slips and landslides through a modular, workflow-driven approach with comprehensive GIS capabilities.
- Modular Library:
psliptoolslibrary with dedicated modules for geometries, rasters, utilities, and scattered data - Multi-format Support: Handles rasters (GeoTIFF, ASC), vectors (Shapefile, GeoJSON), and CSV data
- CRS Flexibility: Supports projected/geographic EPSG codes with automatic reprojection
- Spatial Operations: Buffering, intersections, clipping, and complex geometric computations
- Sequential Scripts: Modular workflow from environment setup (
m00a) to alerts (m07a) - Data Persistence: PKL-based variable storage for efficient state management
- Configuration System: JSON-based analysis environment with flexible parameter control
- Dependency Tracking: Automatic validation of script prerequisites
- Morphological Analysis: Slope, aspect, curvature, flow routing computations
- Time-Sensitive Processing: Rainfall interpolation, mobile averages, event detection
- Path Simulation: Landslide path generation with customizable parameters
- Alert Systems: Attention pixel identification and risk assessment
- Parameter Attribution: Soil and vegetation property assignment
- Hardware-Aware: Monitors RAM/CPU usage, limits computations based on available resources
- Memory Management: Efficient chunked processing for large datasets
- Interactive/CLI: Both prompt-based and command-line interface options
- Comprehensive Logging: Detailed session logs for debugging and monitoring
P-SLIP is an enhanced Python port of the M-SLIP MATLAB app, providing:
- π Better Performance: Optimized Python implementation with NumPy/GeoPandas
- π§ Enhanced Modularity: Clean separation of concerns with dedicated libraries
- π Python Ecosystem: Integration with standard GIS and scientific Python tools
- π Comprehensive Documentation: Detailed guides and troubleshooting
It is designed to eventually replace M-SLIP while maintaining compatibility with existing workflows.
- Python: 3.10 or higher
- RAM: 8+ GB recommended (16+ GB for large datasets)
- Storage: 5+ GB free space for dependencies and analysis outputs
-
Clone the Repository:
git clone https://github.com/sasa-misia/P-SLIP.git cd P-SLIP -
Create Conda Environment (Recommended for GDAL/GeoPandas):
conda create -n pslip python=3.10 -y conda activate pslip
-
Install Dependencies:
# Core dependencies pip install -r requirements.txt # Optional dependencies (for advanced features) pip install -r requirements_opt.txt
-
Verify Installation:
python -c "import geopandas, rasterio, psliptools; print('β P-SLIP installation successful!')"
π Full installation guide: docs/installation.md
-
Initialize Analysis Environment:
cd src/scripts python m00a_env_init.py --base_dir /path/to/your/analysis/case -
Define Study Area:
python m01a_study_area.py --base_dir /path/to/your/analysis/case --source_mode reference_points
-
Continue with Sequential Processing:
# Import properties and DTM python m02a1_import_properties_vectors.py --base_dir /path/to/your/analysis/case python m03a_dtm_base_grid.py --base_dir /path/to/your/analysis/case # Compute parameters and morphology python m04a_parameter_indexing.py --base_dir /path/to/your/analysis/case python m04b_morphological_grids.py --base_dir /path/to/your/analysis/case # Generate outputs python m07a_attention_pixels_alert.py --base_dir /path/to/your/analysis/case
graph TD
A["ποΈ m00a: Environment Init<br/>π Creates analysis structure<br/>πΎ Saves: env.pkl"] --> B["πΊοΈ m01a: Study Area<br/>π Defines analysis bounds<br/>πΎ Saves: study_area_vars.pkl"]
B --> C["ποΈ m02a1/2: Properties<br/>π¦ Imports vectors/rasters<br/>πΎ Saves: {source_type}_vars.pkl"]
B --> D["ποΈ m03a: DTM Grid<br/>π Creates base grids<br/>πΎ Saves: dtm_vars.pkl"]
D --> E[π m04a: Parameter Indexing<br/>π’ Assigns soil/veg params<br/>πΎ Saves: parameter_vars.pkl]
D --> F[β°οΈ m04b: Morphology<br/>π Computes slopes/curvatures<br/>πΎ Saves: morphology_vars.pkl]
D --> G["β° m04c: Time-Sensitive<br/>π§οΈ Processes rainfall data<br/>πΎ Saves: {ts_type}_vars.pkl"]
D --> H[π€οΈ m04d: Paths<br/>π§ Generates flow paths<br/>πΎ Saves: landslide_paths_vars.pkl]
E --> I[π m05a: Reference Points<br/>π― Creates monitoring points<br/>π Outputs: ref_points.csv]
G --> J["π
m05b: Time Analysis<br/>π Event detection<br/>πΎ Updates: {ts_type}_vars.pkl"]
H --> K[π¨ m07a: Alerts<br/>β οΈ Attention pixels<br/>π Outputs: alerts.csv]
style A fill:#e1f5fe,stroke:#01579b,stroke-width:2px
style K fill:#ffebee,stroke:#c62828,stroke-width:2px
π Detailed workflow guide: docs/scripts_guide.md
Explore the comprehensive documentation in the docs folder:
- π Index & Overview - Complete platform introduction and navigation
- π§ Installation Guide - Detailed setup instructions and requirements
- π― Quick Start Guide - Workflow overview and execution order
- βοΈ Configuration Guide - Analysis environment and parameter configuration
- ποΈ Analysis Structure - Folder structure and object documentation
- Analysis Environment - Object structure and methods
- Folder Structure - Directory organization
- π οΈ psliptools Library - Complete library reference
- π Script Details - Comprehensive documentation for each script
- Main Scripts - Core workflow scripts (m00a-m07a)
- Optional Scripts - Additional analysis tools
- π Troubleshooting Guide - Common issues and solutions
- β FAQ - Frequently asked questions
P-SLIP/
βββ π src/
β βββ π§ config/ # Configuration management
β βββ π οΈ psliptools/ # Core processing library
β β βββ geometries/ # Vector operations
β β βββ rasters/ # Raster processing
β β βββ scattered/ # Point cloud/time-series
β β βββ utilities/ # Helper functions
β βββ π scripts/ # Workflow scripts
β βββ mains/ # Core workflow (m00a-m07a)
β βββ optional/ # Additional tools
βββ π docs/ # Comprehensive documentation
βββ π requirements.txt # Dependencies
- GIS Processing: GeoPandas, Rasterio, Shapely, GDAL
- Scientific Computing: NumPy, SciPy, Pandas
- Visualization: Matplotlib, Mayavi (optional)
- Configuration: JSON, PKL serialization
- CLI Interface: argparse, click
- Landslide Risk Assessment: Susceptibility mapping and hazard evaluation
- Early Warning Systems: Real-time monitoring and alert generation
- Research & Education: Academic research and teaching geospatial analysis
- Infrastructure Planning: Risk evaluation for construction projects
- Post-Fire Debris Flows: Assessing landslide risk after wildfires
- Heavy Rainfall Events: Monitoring and predicting rainfall-induced landslides
- Seismic Hazard Analysis: Evaluating earthquake-triggered landslide potential
- Land Use Planning: Incorporating landslide risk into development decisions
P-SLIP is under active development. We welcome contributions from the community!
- Report Issues: Found a bug? Have a feature request? Open an issue
- Submit Pull Requests: Improvements to code, documentation, or examples
- Share Use Cases: Tell us how you're using P-SLIP in your work
- Improve Documentation: Help make P-SLIP more accessible to users
# Fork and clone the repository
git clone https://github.com/your-username/P-SLIP.git
cd P-SLIP
# Create development environment
conda create -n pslip-dev python=3.10 -y
conda activate pslip-dev
pip install -r requirements.txt
pip install -r requirements_opt.txt
# Install development tools
pip install pytest pytest-cov black flake8
# Run tests (when available)
pytest tests/
# Format code
black src/- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Contact the maintainer for collaboration opportunities
P-SLIP is released under the MIT License.
- M-SLIP: The original MATLAB implementation that inspired this project
- Research Community: For feedback, testing, and use cases
- Open Source Projects: GeoPandas, Rasterio, NumPy, and the broader Python geospatial ecosystem
Thank you for your interest in P-SLIP! π
Built with β€οΈ for the geospatial analysis community