West Pokot Sewerage Geoportal
# West Pokot County Government - Sewerage Network Web GIS Pipeline
### Municipal Infrastructure Digitization for Kapenguria & Makutano Urban Centers
An open-source, production-ready Geospatial Information System (GIS) pipeline designed to map, validate, and maintain newly constructed, unmapped sewerage networks in West Pokot County, Kenya.
---
## 🏗️ Architecture Overview
```
[ Field Data / GPS Surveys ]
│
â–Ľ
[ Python / GeoPandas Pipeline ] ───▶ [ GeoJSON Exports: manholes & sewer_lines ]
│ │
â–Ľ â–Ľ
[ PostGIS Spatial Database ] [ Streamlit + Folium Dashboard ]
(SRID 4326, Topological Trigger) (Interactive Map & Maintenance Logging)
```
1. **PostGIS Spatial Database (`schema.sql`)**:
- `manholes`: Point geometry, WGS 84 (SRID 4326), depth, invert levels, ground elevation.
- `sewer_lines`: LineString geometry, WGS 84 (SRID 4326), diameter, material, hydraulic slope.
- `maintenance_logs`: Relational audit log for overflows, blockages, and work orders.
- **Topological Integrity Trigger (`fn_validate_sewer_line_topology`)**: Automatically verifies that pipe endpoints snap within 1.5m tolerance of designated manholes.
2. **Mock Data Generator (`generate_data.py`)**:
- Uses `shapely` and `geopandas` to generate 10 manholes and 9 connecting gravity sewer line segments in Kapenguria/Makutano (Lat 1.23 to 1.26, Lon 35.10 to 35.13).
- Generates `manholes.geojson` and `sewer_lines.geojson`.
3. **Interactive Web Map Dashboard (`app.py`)**:
- Built with `streamlit` and `folium` / `streamlit-folium`.
- Visualizes sewer line conditions (Green for Functional, Red for Blocked).
- Provides a sidebar form widget **"Log Maintenance Issue"** that dynamically simulates asset status changes, creates maintenance logs, and updates map markers in real-time.
---
## 🚀 Quickstart Guide
### 1. Prerequisites
- Python 3.10+
- (Optional) PostgreSQL 14+ with PostGIS 3+
### 2. Installation
```bash
# Clone th …