Landslide Science Rule · area_body
← All rules

area_body → writes area_body

1556 already match 0 would change

Function source

This is read live from inventory/derived.py via inspect.getsource(); what you see is exactly what runs.

def compute_area_body():
    """Sum of body-polygon areas for this landslide (NULL for catastrophic).

    Aggregates `landslide_polygons.area` (which `polygon_area` populates) for
    rows where role='body'. Slow landslides typically have one body polygon
    but the SUM handles multi-polygon cases too.
    """
    return """
        SELECT l.id,
               SUM(p.area) FILTER (WHERE p.role = 'body')::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
    """

Proposed changes

All rows already match this rule — nothing to apply.