diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 94128805..c26cf253 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -155,8 +155,8 @@ def filter_tags_from_country_osm_pbf_files(self): # pylint: disable=too-many-st run_subprocess_and_log_output( cmd, f'! Error in OSMFilter with country: {key}') - val['filtered_file'] = out_file_o5m_filtered_win - val['filtered_file_names'] = out_file_o5m_filtered_names_win + val['filtered_file'] = out_file_o5m_filtered_win.replace("/", "\\") + val['filtered_file_names'] = out_file_o5m_filtered_names_win.replace("/", "\\") # Non-Windows else: @@ -374,7 +374,7 @@ def split_filtered_country_files_to_tiles(self): for tile in self.o_osm_data.tiles: for country, val in self.o_osm_data.border_countries.items(): - if country not in tile['countries']: + if country not in tile['countries'] and country.replace("/","_") not in tile['countries']: continue self.log_tile_info(tile["x"], tile["y"], tile_count, country) timings_tile = Timings() @@ -393,7 +393,7 @@ def split_filtered_country_files_to_tiles(self): cmd.extend( ['--complete-ways', '--complete-multipolygons', '--complete-boundaries']) cmd.append(val['filtered_file']) - cmd.append('-o='+out_file) + cmd.append('-o='+out_file.replace("/","_")) run_subprocess_and_log_output( cmd, f'! Error in osmconvert with country: {country}. Win/out_file') @@ -405,10 +405,10 @@ def split_filtered_country_files_to_tiles(self): cmd.extend( ['--complete-ways', '--complete-multipolygons', '--complete-boundaries']) cmd.append(val['filtered_file_names']) - cmd.append('-o='+out_file_names) + cmd.append('-o='+out_file_names.replace("/","_")) run_subprocess_and_log_output( - cmd, '! Error in osmconvert with country: {country}. Win/out_file_names') + cmd, f'! Error in osmconvert with country: {country}. Win/out_file_names') # Non-Windows else: @@ -417,22 +417,22 @@ def split_filtered_country_files_to_tiles(self): ['-b', f'{tile["left"]},{tile["bottom"]},{tile["right"]},{tile["top"]}']) cmd.append(val['filtered_file']) cmd.extend(['-s', 'smart']) - cmd.extend(['-o', out_file]) + cmd.extend(['-o', out_file.replace("-us/","-us_")]) cmd.extend(['--overwrite']) run_subprocess_and_log_output( - cmd, '! Error in Osmium with country: {country}. macOS/out_file') + cmd, f'! Error in Osmium with country: {country}. macOS/out_file') cmd = ['osmium', 'extract'] cmd.extend( ['-b', f'{tile["left"]},{tile["bottom"]},{tile["right"]},{tile["top"]}']) cmd.append(val['filtered_file_names']) cmd.extend(['-s', 'smart']) - cmd.extend(['-o', out_file_names]) + cmd.extend(['-o', out_file_names.replace("-us/","-us_")]) cmd.extend(['--overwrite']) run_subprocess_and_log_output( - cmd, '! Error in Osmium with country: {country}. macOS/out_file_names') + cmd, f'! Error in Osmium with country: {country}. macOS/out_file_names') self.log_tile_debug(tile["x"], tile["y"], tile_count, f'{country} {timings_tile.stop_and_return()}') @@ -478,7 +478,7 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto # loop through all countries of tile, if border-countries should be processed. # if border-countries should not be processed, only process the "entered" country for country in tile['countries']: - if process_border_countries or country in self.o_osm_data.border_countries: + if process_border_countries or country in self.o_osm_data.border_countries or country.replace("_", "/") in self.o_osm_data.border_countries: cmd.append('--rbf') cmd.append(os.path.join( out_tile_dir, f'split-{country}.osm.pbf'))