Landslide Science
Rule · area_source
area_source
→ writes area_source
This is read live from inventory/derived.py via
inspect.getsource(); what you see is exactly what runs.
def compute_area_source():
"""Sum of source-polygon areas for this landslide (NULL for slow).
Aggregates `landslide_polygons.area` for rows where role='source'.
For multi-source catastrophic landslides the SUM is what size_inclusion
considers.
"""
return """
SELECT l.id,
SUM(p.area) FILTER (WHERE p.role = 'source')::float8 AS computed
FROM landslides l
LEFT JOIN landslide_polygons p ON p.landslide_id = l.id
GROUP BY l.id
ORDER BY l.id
"""
All rows already match this rule — nothing to apply.