Skip to content

Commit a88d4a3

Browse files
rusackasclaude
andcommitted
fix(country-map): simplify Russia's Karelia and Murmansk 1:10m rows
Restores the original size guard on russia.geojson. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 34473f2 commit a88d4a3

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎superset-frontend/plugins/plugin-chart-country-map/scripts/maps/countries/russia.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@
3333
NAME = "russia"
3434

3535
_CORRECTED_REGIONS = ["Karelia", "Murmansk"]
36+
_CORRECTION_SIMPLIFY_TOLERANCE = 0.03
3637

3738

3839
def build(ctx: BuildContext) -> dict[str, gpd.GeoDataFrame]:
3940
russia_50m = ctx.df_50m[(ctx.df_50m.admin == "Russia") & ctx.df_50m.name.notna()]
4041
russia_10m_corrections = ctx.df_10m[
4142
(ctx.df_10m.admin == "Russia") & ctx.df_10m.name.isin(_CORRECTED_REGIONS)
42-
]
43+
].copy()
44+
# The 1:10m rows are far denser than the 1:50m ones around them; simplify
45+
# them so the payload stays close to the 1:50m baseline.
46+
russia_10m_corrections["geometry"] = russia_10m_corrections.geometry.simplify(
47+
_CORRECTION_SIMPLIFY_TOLERANCE, preserve_topology=False
48+
)
4349
russia = pd.concat(
4450
[
4551
russia_50m[~russia_50m.name.isin(_CORRECTED_REGIONS)],

0 commit comments

Comments
 (0)