From 36069e3acd0134fb5b92c0996939135cab09d9e0 Mon Sep 17 00:00:00 2001 From: hdevine825 Date: Thu, 23 Jan 2025 00:48:56 -0700 Subject: [PATCH 1/4] Solve Osmosis error from too many --m flags --- wahoomc/osm_maps_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 9eec9f15..53dd9901 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -496,12 +496,12 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto for land in land_files: cmd.extend( - ['--rx', 'file='+land, '--s', '--m']) + ['--rx', 'file='+land, '--s']) if contour: for elevation in elevation_files: cmd.extend( - ['--rx', 'file='+elevation, '--s', '--m']) + ['--rx', 'file='+elevation, '--s']) cmd.extend( ['--rx', 'file='+os.path.join(out_tile_dir, 'sea.osm'), '--s', '--m']) From 0dcce73509952f30df6b11e47ad6b5ca950befe4 Mon Sep 17 00:00:00 2001 From: hdevine825 Date: Thu, 23 Jan 2025 00:59:41 -0700 Subject: [PATCH 2/4] Add method to add appropriate --m flags after the second Osmosis import file --- wahoomc/osm_maps_functions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 53dd9901..5d5b7d78 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -493,15 +493,18 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto cmd.append('--merge') loop += 1 - + + loop = 0 for land in land_files: cmd.extend( ['--rx', 'file='+land, '--s']) - + if loop > 0: + cmd.append('--m') + loop += 1 if contour: for elevation in elevation_files: cmd.extend( - ['--rx', 'file='+elevation, '--s']) + ['--rx', 'file='+elevation, '--s', '--m']) cmd.extend( ['--rx', 'file='+os.path.join(out_tile_dir, 'sea.osm'), '--s', '--m']) From 447efa4e246a417d9029133561c33466b8c497c0 Mon Sep 17 00:00:00 2001 From: hdevine825 Date: Thu, 23 Jan 2025 01:20:19 -0700 Subject: [PATCH 3/4] Fix lint errors --- wahoomc/osm_maps_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 5d5b7d78..5986b06b 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -493,13 +493,13 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto cmd.append('--merge') loop += 1 - + loop = 0 for land in land_files: cmd.extend( ['--rx', 'file='+land, '--s']) if loop > 0: - cmd.append('--m') + cmd.append('--m') loop += 1 if contour: for elevation in elevation_files: From 4d646f7bc86b58c534707dbfd28dc1a31f761f10 Mon Sep 17 00:00:00 2001 From: Benjamin Kreuscher Date: Tue, 22 Apr 2025 15:39:18 +0200 Subject: [PATCH 4/4] add comment and empty lines --- wahoomc/osm_maps_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 5986b06b..7be4b8e0 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -495,12 +495,15 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto loop += 1 loop = 0 + # loop through all land* osm files, merge only if more than one file is involved. for land in land_files: cmd.extend( ['--rx', 'file='+land, '--s']) if loop > 0: cmd.append('--m') + loop += 1 + if contour: for elevation in elevation_files: cmd.extend(