Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV] use pyhgtmap instead of phyghtmap for generating contour lines #234

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
23 changes: 23 additions & 0 deletions conda_env/gdal-dev-pyh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: gdal-dev-pyh
channels:
- conda-forge
dependencies:
- python=3.10
- gdal=3.6.*
- requests=2.28.*
- pylint=2.15.*
- geojson=2.5.*
- shapely=1.8.*
- osmium-tool=1.15.*
- bs4=4.11.*
- lxml=4.9.*
- matplotlib=3.4.3
- autopep8=2.0.*
- mock
- twine
- pip
- vulture
- pydeps
- pip:
- build
- pyhgtmap
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ classifiers =
[options]
packages = wahoomc, wahoomc.init
python_requires = >=3.10
install_requires =
pyhgtmap

[options.package_data]
wahoomc = resources/*.*, resources/*/*.*, resources/*/*/*.*, resources/*/*/*/*.*, tooling_win/*.*, tooling_win/*/*.*, tooling_win/*/*/*.*, tooling_win/*/*/*/*.*
6 changes: 4 additions & 2 deletions wahoomc/osm_maps_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def generate_elevation(self, use_srtm1):
or self.o_osm_data.force_processing is True:
self.log_tile_info(tile["x"], tile["y"], tile_count)
timings_tile = Timings()
cmd = ['phyghtmap']
# TODO: remove chapter wahooMapsCreator/docs/QUICKSTART_ANACONDA.md#additional-programs-for-generating-contour-lines
# when switching to pyhgtmap
cmd = ['pyhgtmap']
cmd.append('-a ' + f'{tile["left"]}' + ':' + f'{tile["bottom"]}' +
':' + f'{tile["right"]}' + ':' + f'{tile["top"]}')
cmd.extend(['-o', f'{out_file_elevation}', '-s 10', '-c 100,50', elevation_source,
Expand All @@ -355,7 +357,7 @@ def generate_elevation(self, use_srtm1):
cmd.append('--earthexplorer-password=' + password)

run_subprocess_and_log_output(
cmd, f'! Error in phyghtmap with tile: {tile["x"]},{tile["y"]}. Win_macOS/elevation')
cmd, f'! Error in pyhgtmap with tile: {tile["x"]},{tile["y"]}. Win_macOS/elevation')
self.log_tile_debug(tile["x"], tile["y"], tile_count, timings_tile.stop_and_return())

tile_count += 1
Expand Down
6 changes: 4 additions & 2 deletions wahoomc/setup_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ def check_installation_of_programs_credentials_for_contour_lines():
\nPlease refer to the Quickstart Guide of wahooMapsCreator for instructions:\n- https://github.com/treee111/wahooMapsCreator/blob/develop/docs/QUICKSTART_ANACONDA.md#additional-programs-for-generating-contour-lines \
\nor create an issue:\n- https://github.com/treee111/wahooMapsCreator/issues"

if not is_program_installed("phyghtmap"):
# TODO: remove chapter wahooMapsCreator/docs/QUICKSTART_ANACONDA.md#additional-programs-for-generating-contour-lines
# when switching to pyhgtmap
if not is_program_installed("pyhgtmap"):
sys.exit(
f"phyghtmap is not installed. {text_to_docu}")
f"pyhgtmap is not installed. {text_to_docu}")

username, password = read_earthexplorer_credentials()

Expand Down
Loading