Skip to content

CR-115: disputed-territory slivers produce duplicate adm0 rows in admin extraction #11

Description

@peetmate

Symptom

Observational adm0_obs.parquet (CHIRPS-CHIRTS-ERA5) ships 2 rows per (iso3, variable, year, month) for disputed-claimant countries. A country gets its main gaul0 polygon row plus each disputed sliver it claims — both admin1/admin2 = NULL — so a naive WHERE iso3='KEN' returns 2 adm0 rows and consumers double-count/plot.

Root cause

R/observational/3_extract_obs_admin.R:245 sets zone_id = gaul0_code at adm0. Disputed slivers carry their own gaul0 code attributed to a claimant iso3 in the boundaries:

  • 135 Ilemi → KEN137 + SSD160
  • 100 Abyei → SSD160 + SDN161
  • 110 Bīr Ṭawīl → EGY120 + SDN161
  • 133 Hala'Ib → EGY120 + SDN161
  • (W. Sahara excluded)

Authoritative mapping: R/misc/calc_disputed_weights.R (has obs-grid cell-count weight logic). terra::zonal returns mean/sd only (no pixel count, but the rasterized adm0 yields cell counts as calc_disputed_weights.R shows). adm0-only — adm1/adm2 are keyed by finer gaul1/gaul2.

Producers affected: 3_extract_obs_admin.R (monthly), 4_aggregate_obs_admin_periods.R (periods); publish via 6_publish_obs_to_s3.R.

Status — pipeline fix ON HOLD

This is not a pipeline-local fix. How disputed territory is attributed/aggregated affects every admin-extracted table in the AAA Atlas (exposure, hazard, hazard_exposure, observational, …) and is politically sensitive, so it needs an Atlas-wide convention rather than a one-pipeline patch.

Escalated to Brayden for a convention call: AdaptationAtlas/data-management#3

Until the convention is set, consumers keep the client-side GROUP BY / AVG dedup. Do not implement producer dedup here until the convention is decided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions