From 594756afeb42ca95fb1f18337348e2109ad57b9d Mon Sep 17 00:00:00 2001 From: Benjamin Kreuscher Date: Fri, 17 Mar 2023 16:07:56 +0100 Subject: [PATCH] set Cache directory for hgt files to user dir instead of cwd documentation: http://katze.tfiu.de/projects/phyghtmap/phyghtmap.1.html --- .gitignore | 3 +-- wahoomc/osm_maps_functions.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7147bdcd..95fe8347 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,4 @@ osmfilter_tempfile.* # mac/unix #windows -/wahoomc/tooling_win/osmconvert_tempfile.* -hgt/* +/wahoomc/tooling_win/osmconvert_tempfile.* \ No newline at end of file diff --git a/wahoomc/osm_maps_functions.py b/wahoomc/osm_maps_functions.py index 2a5f2271..f150c810 100644 --- a/wahoomc/osm_maps_functions.py +++ b/wahoomc/osm_maps_functions.py @@ -27,6 +27,7 @@ from wahoomc.constants import LAND_POLYGONS_PATH from wahoomc.constants import VERSION from wahoomc.constants import OSMOSIS_WIN_FILE_PATH +from wahoomc.constants import USER_DL_DIR from wahoomc.downloader import Downloader from wahoomc.geofabrik import CountryGeofabrik, XYGeofabrik @@ -490,6 +491,8 @@ def generate_elevation(self, o_input_data): log.info('-' * 80) log.info('# Generate contour lines for each coordinate') + hgt_path = os.path.join(USER_DL_DIR, 'hgt') + tile_count = 1 for tile in self.o_osm_data.tiles: out_file_elevation = os.path.join( @@ -509,7 +512,7 @@ def generate_elevation(self, o_input_data): cmd.extend(['-o', f'{out_file_elevation}', '-s 10', '-c 100,50', '--source=view1,view3,srtm3', '--jobs=8', '--viewfinder-mask=1', '--start-node-id=20000000000', '--max-nodes-per-tile=0', '--start-way-id=2000000000', '--write-timestamp', - '--no-zero-contour']) + '--no-zero-contour', '--hgtdir=' + hgt_path]) cmd.append('--earthexplorer-user=' + username) cmd.append('--earthexplorer-password=' + password)