Static GIS risk score per 100m chainage of the Purple Line South alignment. Computed from open data: OSM canals, BMA flood zones, Bangkok marine clay. Scores follow the 6-factor risk formula from the user's QGIS document.
| Chainage | Score | Class | Canal | Flood | Soil |
|---|
| Canal proximity | within 50m=+3, 100m=+2, 250m=+1 |
| Flood-risk zone | intersects=+3, within 250m=+2, 500m=+1 |
| Elevation (low point) | <1m=+2, <3m=+1 |
| Building density | dense=+2, medium=+1 |
| Soil/geology | marine clay=+2, moderate=+1 |
| Rainfall | heavy=+2, moderate=+1 |
| Total | 0-3=LOW ยท 4-7=MEDIUM ยท 8+=HIGH |
Source: User's QGIS document โ Wongwian Yai tunnel risk formula.
Open data identifies WHERE risk is highest. Engineering telemetry (MRTA piezometers, TBM, pumps) detects WHEN an incident starts. Two separate pipelines, one dashboard.
Python CLI โ reads GeoJSON layers, computes 6-factor risk per 100m chainage, outputs GeoJSON.
python3 gis/risk_scorer.py --sample --pretty
python3 gis/risk_scorer.py --alignment alignment.geojson --canals canals.geojson --flood flood_zones.geojson --soil soil_zones.geojson --output output.geojson
/root/sinkalert/gis/risk_scorer.py
PyQGIS script + AI prompt for QGIS-MCP. Loads alignment, OSM layers, buffers, risk scores, exports PDF map + CSV table.
/root/sinkalert/gis/qgis_tunnel_risk.py
/root/sinkalert/gis/qgis_mcp_prompt.txt
Pre-computed risk segments + sample input layers. Load into QGIS, GeoLibre, or MapLibre.
wongwianyai_risk_segments.geojson
alignment.geojson ยท canals.geojson
flood_zones.geojson ยท soil_zones.geojson