diff --git a/.vscode/launch.json b/.vscode/launch.json index efafff61..db725ccb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -302,6 +302,22 @@ "--verbose" ], "justMyCode": false + }, + { + "name": "xy: Plauen - contour #145", + "type": "python", + "request": "launch", + "module": "wahoomc", + "console": "integratedTerminal", + "args": [ + "cli", + "-xy", + "136/86", + "-fp", + "-c", + "-con" + // "-srtm1" + ] } ] } \ No newline at end of file diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 59dc57bb..af2d76ba 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -531,17 +531,24 @@ def generate_elevation(self, use_srtm1): for tile in self.o_osm_data.tiles: out_file_elevation = os.path.join( USER_OUTPUT_DIR, f'{tile["x"]}', f'{tile["y"]}', 'elevation') - # as the elevation file has a suffix, they need to be searched with glob.glob + + # 1) as the elevation file has a suffix, they need to be searched with glob.glob # example elevation filename: elevation_lon14.06_15.47lat35.46_36.60_view1,view3.osm - out_file_elevation_existing = glob.glob(os.path.join( - USER_OUTPUT_DIR, str(tile["x"]), str(tile["y"]), 'elevation*.osm')) - # use view1 as default source and srtm1 if wished by the user + # 2) use view1 as default source and srtm1 if wished by the user # view1 offers better quality in general apart fro some places # where srtm1 is the better choice if use_srtm1: + # 1) search for srtm1 elevation files + out_file_elevation_existing = glob.glob(os.path.join( + USER_OUTPUT_DIR, str(tile["x"]), str(tile["y"]), 'elevation*srtm1*.osm')) + # 2) set source elevation_source = '--source=srtm1,view1,view3,srtm3' else: + # 1) search vor view1 elevation files + out_file_elevation_existing = glob.glob(os.path.join( + USER_OUTPUT_DIR, str(tile["x"]), str(tile["y"]), 'elevation*view1*.osm')) + # 2) set source elevation_source = '--source=view1,view3,srtm3' # check for already existing elevation .osm file (the ones matched via glob)