bikash-barnwal commented on issue #41883:
URL: https://github.com/apache/superset/issues/41883#issuecomment-5298431263

   Confirmed, with exact numbers from the checked-in file 
(`plugin-chart-country-map/src/countries/madagascar.geojson`):
   
   - **22 features**, each one a *region* polygon
   - only **6 distinct `ISO` values**, and **all 6 are duplicated**
   
   ```
   MG-A ×3: Alaotra-Mangoro, Analanjirofo, Atsinanana
   MG-D ×2: Diana, Sava
   MG-F ×5: Amoron'i Mania, Atsimo-Atsinanana, Haute Matsiatra, Ihorombe, 
Vatovavy-Fitovinany
   MG-M ×4: Betsiboka, Boeny, Melaky, Sofia
   MG-T ×4: Analamanga, Bongolava, Itasy, Vakinankaratra
   MG-U ×4: Androy, Anosy, Atsimo-Andrefana, Menabe
   ```
   
   Each feature carries only `ISO` and `NAME_1`. So the geometry is already at 
the right admin level — it is purely the identifier that is a province code, 
which is why values collapse to province-level sums.
   
   Relevant constraint for whoever picks this up: the plugin matches strictly 
on `properties.ISO`, in several places, against the user's selected column — 
`CountryMap.ts:131`, `:174`, `:204`, `:254` (`data.filter(r => r.country_id === 
d?.properties?.ISO)`), `:340`, `:344`. `NAME_1` is used only for the tooltip 
label (`:227`). There is no fallback, so uniqueness has to live in `ISO` 
itself; adding a separate `REGION_ID` property would need plugin changes 
alongside the data.
   
   That makes this a real decision rather than a data patch, which is 
presumably why it is filed as design input:
   
   1. **Region names as `ISO`** — self-documenting, no external source needed, 
and the names are already in the file. Costs: they are not ISO codes despite 
the property name and the control's "ISO 3166-2 Codes" label, and they contain 
apostrophes/hyphens (`Amoron'i Mania`).
   2. **An unofficial code set** (GADM `MDG.n_1`, or HASC) — looks like a code, 
but is not ISO either and needs sourcing.
   
   Either way it is a **breaking change for existing dashboards**: charts 
currently keyed on `MG-A`…`MG-U` would stop matching. They are producing 
province-level sums today rather than the region values users expect, so 
arguably that is the point — but it warrants a note in `UPDATING.md`.
   
   Two smaller corrections to the issue text: the file has 22 features, not 21, 
and Madagascar now has 23 regions, so whichever scheme is chosen the file is 
also one region short and would need a geometry refresh from an authoritative 
source to be complete.
   
   Happy to implement whichever identifier scheme maintainers prefer — I did 
not want to pick one unilaterally, since it changes the meaning of a 
user-facing column.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to