Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,7 @@
"#### Iran\n",
"\n",
"- Tehran and Alborz share the same Natural Earth `iso_3166_2` code (`IR-07`), and Razavi Khorasan is mislabeled with Alborz's real code (`IR-30`), leaving `IR-09` unused.\n",
"- Alborz gets its pre-2020 code `IR-32` rather than the 2020 renumbering's `IR-30`: every other province in this map still uses the pre-2020 numbering, so `IR-32` is the code that is consistent with the rest of the file (and the one existing datasets are keyed on since #42429).\n",
"- Fix the codes here (rather than in the generated GeoJSON) so the correction survives regeneration from upstream Natural Earth data. See [ISO 3166-2:IR](https://en.wikipedia.org/wiki/ISO_3166-2:IR)."
]
},
Expand Down Expand Up @@ -2336,7 +2337,7 @@
"source": [
"iran = df[df.admin == 'Iran']\n",
"iran_copy = iran.copy()\n",
"iran_copy.loc[iran_copy['name'] == 'Alborz', 'iso_3166_2'] = 'IR-30'\n",
"iran_copy.loc[iran_copy['name'] == 'Alborz', 'iso_3166_2'] = 'IR-32'\n",
"iran_copy.loc[iran_copy['name'] == 'Razavi Khorasan', 'iso_3166_2'] = 'IR-09'\n",
"\n",
"not speed_run and iran_copy.plot(**plot_styles)"
Expand Down Expand Up @@ -2682,7 +2683,7 @@
"source": [
"#### Russia\n",
"\n",
"Natural Earth's 1:50m data incorrectly merges Karelia into Murmansk. Replace only those two regions with their correct 1:10m boundaries so the rest of Russia retains the smaller 1:50m payload, then apply the existing dateline adjustment. See [Natural Earth #929](https://github.com/nvkelso/natural-earth-vector/issues/929)."
"Natural Earth's 1:50m data incorrectly merges Karelia into Murmansk. Replace only those two regions with their correct 1:10m boundaries so the rest of Russia retains the smaller 1:50m payload. The 1:10m rows are much denser than the 1:50m ones around them (and Russia, as a 1:50m country, skips the size-based simplification at output time), so simplify them with the same 0.03 tolerance that step uses for the largest countries to keep `russia.geojson` within its size budget. Then apply the existing dateline adjustment. See [Natural Earth #929](https://github.com/nvkelso/natural-earth-vector/issues/929)."
]
},
{
Expand Down Expand Up @@ -2713,7 +2714,8 @@
"russia_50m = df_50m[(df_50m.admin == 'Russia') & df_50m.name.notna()]\n",
"russia_10m_corrections = df_10m[\n",
" (df_10m.admin == 'Russia') & df_10m.name.isin(corrected_russian_regions)\n",
"]\n",
"].copy()\n",
"russia_10m_corrections['geometry'] = russia_10m_corrections.simplify(0.03)\n",
"russia = pd.concat([\n",
" russia_50m[~russia_50m.name.isin(corrected_russian_regions)],\n",
" russia_10m_corrections,\n",
Expand Down Expand Up @@ -3531,7 +3533,9 @@
"id": "tTpJe28jt1LW"
},
"source": [
"#### UK"
"#### UK\n",
"\n",
"- Natural Earth labels Wirral (`GB-WRL`) as \"Halton\", which duplicates the real Halton (`GB-HAL`) and breaks lookups by region name. Restore its name."
]
},
{
Expand Down Expand Up @@ -3587,6 +3591,7 @@
],
"source": [
"uk_copy = apply_bounds(uk, (-10, 60), (20, 20))\n",
"uk_copy.loc[uk_copy['iso_3166_2'] == 'GB-WRL', 'name'] = 'Wirral'\n",
"not speed_run and uk_copy.plot(figsize=(8, 8), **plot_styles)"
]
},
Expand Down Expand Up @@ -4444,6 +4449,9 @@
" if (x === 'italy_regions') {\n",
" return [x, 'Italy (regions)'];\n",
" }\n",
" if (x === 'italy_regions_and_autonomous_provinces') {\n",
" return [x, 'Italy (regions and autonomous provinces)'];\n",
" }\n",
" if (x === 'france_regions') {\n",
" return [x, 'France (regions)'];\n",
" }\n",
Expand Down Expand Up @@ -4478,6 +4486,9 @@
"# Replace underscores with spaces and title-case each country name\n",
"formatted_countries = [country.replace(\"_\", \" \") for country in countries_combined]\n",
"formatted_countries = [country.upper() if country in {\"usa\", \"uk\"} else country.title() for country in formatted_countries]\n",
"# Must run before the generic \" Regions\" rule, which would otherwise yield\n",
"# \"Italy (regions) And Autonomous Provinces\"\n",
"formatted_countries = [country.replace(\"Italy Regions And Autonomous Provinces\", \"Italy (regions and autonomous provinces)\") for country in formatted_countries]\n",
"formatted_countries = [country.replace(\" Regions\",\" (regions)\") for country in formatted_countries]\n",
"formatted_countries = [country.replace(\" Overseas\",\" (with overseas)\") for country in formatted_countries]\n",
"\n",
Expand Down
Loading