Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions wahoomc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ def run(run_level):

# Merge splitted tiles with land and sea
o_osm_maps.merge_splitted_tiles_with_land_and_sea(
o_input_data.process_border_countries, o_input_data.contour)
o_input_data.process_border_countries, o_input_data.contour, o_input_data.verbose)

# Creating .map files
o_osm_maps.create_map_files(o_input_data.save_cruiser,
o_input_data.tag_wahoo_xml,
o_input_data.hdd_mode)
o_input_data.hdd_mode,
o_input_data.verbose)

# Zip .map.lzma files
o_osm_maps.make_and_zip_files('.map.lzma', o_input_data.zip_folder)
Expand Down
24 changes: 18 additions & 6 deletions wahoomc/osm_maps_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def split_filtered_country_files_to_tiles(self):

log.info('+ Split filtered country files to tiles: OK, %s', timings.stop_and_return())

def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, contour): # pylint: disable=too-many-locals
def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, contour, verbose_debug): # pylint: disable=too-many-locals
"""
Merge splitted tiles with land elevation and sea
- elevation data only if requested
Expand Down Expand Up @@ -508,8 +508,14 @@ def merge_splitted_tiles_with_land_and_sea(self, process_border_countries, conto
cmd.extend(['--tag-transform', 'file=' + os.path.join(RESOURCES_DIR,
'tunnel-transform.xml'), '--wb', out_file_merged, 'omitmetadata=true'])

run_subprocess_and_log_output(
cmd, f'! Error in Osmosis with tile: {tile["x"]},{tile["y"]}')
if platform.system() == "Windows" and verbose_debug:
result = subprocess.run(cmd, check=False)
if result.returncode != 0:
print(f'! Error in Osmosis with tile: {tile["x"]},{tile["y"]}')
sys.exit()
else:
run_subprocess_and_log_output(
cmd, f'! Error in Osmosis with tile: {tile["x"]},{tile["y"]}')

self.log_tile_debug(tile["x"], tile["y"], tile_count, timings_tile.stop_and_return())
tile_count += 1
Expand Down Expand Up @@ -545,7 +551,7 @@ def sort_osm_files(self, tile):

log.debug('+ Sorting land* osm files: OK')

def create_map_files(self, save_cruiser, tag_wahoo_xml, hdd_mode):
def create_map_files(self, save_cruiser, tag_wahoo_xml, hdd_mode, verbose_debug):
"""
Creating .map files
"""
Expand Down Expand Up @@ -595,8 +601,14 @@ def create_map_files(self, save_cruiser, tag_wahoo_xml, hdd_mode):
'The tag-wahoo xml file was not found: ˚%s˚. Does the file exist and is your input correct?', tag_wahoo_xml)
sys.exit()

run_subprocess_and_log_output(
cmd, f'Error in creating map file via Osmosis with tile: {tile["x"]},{tile["y"]}. mapwriter plugin installed?')
if platform.system() == "Windows" and verbose_debug:
result = subprocess.run(cmd, check=False)
if result.returncode != 0:
print(f'Error in creating map file via Osmosis with tile: {tile["x"]},{tile["y"]}. mapwriter plugin installed?')
sys.exit()
else:
run_subprocess_and_log_output(
cmd, f'Error in creating map file via Osmosis with tile: {tile["x"]},{tile["y"]}. mapwriter plugin installed?')

# Windows
if platform.system() == "Windows":
Expand Down