6c Get Deforestation Metrics

Step 6c: Get Deforestation Metrics

Retrieve deforestation metrics for all facilities in the task. Join these to the assets table and map tooltips by attributes.facility_id.

What this step does

It reads the per-shed deforestation results computed in Step 4 from /metrics/sheds/deforestation, scoped by filter[assets.task_id]. Each metric carries the risk figures โ€” noncompliance_area, forest_area, annual_defor, area โ€” and an attributes.facility_id for joining back to the facilities from Step 6a.

Why it's needed

The facilities from 6a are just geometry and identity; the deforestation risk that colours them and populates their tooltips lives on this separate metric resource. This read is what turns the map from a set of grey polygons into a risk view โ€” join facility_id to the facility ids and derive the risk ratio (noncompliance_area / area). Without it there are no deforestation values to display.

Request

GET /metrics/sheds/deforestation?filter[assets.task_id]=eq:{process-task-id}

Query parameters:

ParameterDescription
filter[assets.task_id]Process task ID from Step 4
filter[commodity]Filter by commodity type
filter[country_code]Filter by country code
page[number]Page number
page[size]Items per page

Data Joining

  • Match attributes.facility_id to facility IDs from Step 6a
  • Metric ID format: {shed_id}:{monitoring_end_date}
  • Use links.facility to navigate directly to the related facility

Assets Table Columns

ColumnSourceDescription
Deforestation Risknoncompliance_area / areaRisk ratio (0โ€“1)
Forest Area (ha)forest_areaTotal forest area in hectares
Annual Deforestationannual_deforAnnual deforestation rate

Map Tooltip Data

  • noncompliance_area: Non-compliant area in hectares
  • forest_area: Forest area in hectares
  • agreement: Model agreement score
  • area: Total analyzed area in hectares