fix(viz): correct duplicate/incorrect ISO codes in Iran country map#42439
fix(viz): correct duplicate/incorrect ISO codes in Iran country map#42439rusackas wants to merge 1 commit into
Conversation
Tehran and Alborz provinces both used IR-07 in the Iran GeoJSON, and Razavi Khorasan was assigned IR-30 (Alborz's actual code), leaving IR-09 unused. This made it impossible to color Tehran and Alborz independently on the country map viz and mapped Razavi Khorasan data to the wrong region. Alborz now uses IR-30 and Razavi Khorasan uses IR-09, matching ISO 3166-2:IR, with a test pinning uniqueness of the ISO codes. Fixes #31991
Code Review Agent Run #bc4e51Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42439 +/- ##
=======================================
Coverage 65.23% 65.23%
=======================================
Files 2795 2795
Lines 157694 157694
Branches 36067 36067
=======================================
Hits 102871 102871
Misses 52847 52847
Partials 1976 1976
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
Tehran and Alborz provinces in
iran.geojsonwere both mapped toIR-07, and Razavi Khorasan was mapped toIR-30(Alborz's real code), leavingIR-09unused entirely. That made it impossible to color Tehran and Alborz independently in the country map viz, and any data keyed onIR-09(Razavi Khorasan) orIR-30(Alborz) would land on the wrong province. This matches what came up in #31991: Alborz now getsIR-30and Razavi Khorasan getsIR-09, per ISO 3166-2:IR. Tehran keepsIR-07.Added a unit test that pins this down going forward by asserting every province in the geojson has a unique ISO code and that the three provinces in question map correctly.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A, this only touches the underlying geojson data, not rendering code.
TESTING INSTRUCTIONS
npm run test -- plugins/legacy-plugin-chart-country-map/test/countries/iran.test.tsOr build a country map chart with country set to Iran and confirm Tehran and Alborz can be colored independently.
ADDITIONAL INFORMATION
Fixes #31991