From 7851c9ea2b4839e1133e770cbe10d050d91720bb Mon Sep 17 00:00:00 2001 From: Miro Date: Mon, 25 May 2026 20:02:44 +0200 Subject: [PATCH] [BUGFIX] Normalize no-border US region names --- tests/test_osm_maps.py | 4 ++++ wahoomc/osm_data.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_osm_maps.py b/tests/test_osm_maps.py index 9eb8db04..f0467b84 100644 --- a/tests/test_osm_maps.py +++ b/tests/test_osm_maps.py @@ -106,6 +106,10 @@ def test_calc_without_border_countries_input_country(self): self.process_and_check_border_countries( 'china', False, {'china': {}}, 'country') + # US regions + self.process_and_check_border_countries( + 'us/texas', False, {'us_texas': {}}, 'country') + # malta,liechtenstein self.process_and_check_border_countries( 'malta,liechtenstein', False, {'malta': {}, 'liechtenstein': {}}, 'country') diff --git a/wahoomc/osm_data.py b/wahoomc/osm_data.py index f7328986..9530b6a0 100644 --- a/wahoomc/osm_data.py +++ b/wahoomc/osm_data.py @@ -150,7 +150,7 @@ def calc_border_countries(self): # set the to-be-processed country as border country else: for country in self.o_geofabrik.wanted_maps: - self.border_countries[country] = {} + self.border_countries[country.replace('/', '_')] = {} def calc_country_name(self): """