From eecf835d2307c92a1e379e5bb3bc1494c1fbb348 Mon Sep 17 00:00:00 2001 From: Jonas Eberle Date: Fri, 6 Dec 2024 01:30:58 +0100 Subject: [PATCH] test tiles with otv (thanks @dyoung522) --- .gitignore | 3 ++- Makefile | 29 +++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index dd1a2db..d9746f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ *.swp -Ortho4XP +/Ortho4XP/ +/otv/ *_tile_list.* /var/ /.venv/ diff --git a/Makefile b/Makefile index 4a55c1b..4ea8f28 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -# Requires Github CLI (gh) command to facilitate authenticated requests to the API +# Requires: +# * Github CLI (gh) command to facilitate authenticated requests to the API +# * pipenv (for otv) # # Quick start: # Generate tile set: @@ -139,6 +141,15 @@ Ortho4XP: && cd ../../../Ortho4XP/Elevation_data \ && find -type f -exec sh -c 'mv {} "$$(tr [:lower:] [:upper:] <<< $$(basename {} .hgt)).hgt"' \; +# +# otv (Tile Checker) +# + +otv: + @echo "[$@]" + git clone --single-branch --branch develop --depth=1 https://github.com/jonaseberle/otv.git + PIPENV_PIPFILE=./otv/Pipfile PIPENV_IGNORE_VIRTUALENVS=1 pipenv install + # # Custom tile elevation # @@ -194,7 +205,7 @@ $(TILENAME)_tile_list_chunks: $(TILENAME)_tile_list # Tile pack setup # -Ortho4XP/Tiles/*/*/*/%.dsf: Ortho4XP var/run/neighboursOfTile_%.elevation +Ortho4XP/Tiles/*/*/*/%.dsf: Ortho4XP var/run/neighboursOfTile_%.elevation otv @echo [$@] @mkdir -p Ortho4XP/Tiles/zOrtho4XP_$* @echo "Setup per tile config, if possible" @@ -205,16 +216,18 @@ Ortho4XP/Tiles/*/*/*/%.dsf: Ortho4XP var/run/neighboursOfTile_%.elevation && hgtLon="$$(grep -Eo '.{4}$$' <<< $* | tr "+" "E" | tr "-" "W")" \ && hgtFilePath=Ortho4XP/Elevation_data/"$$hgtLat$$hgtLon".hgt \ && ( [ -e "$$hgtFilePath" ] && ls -sh "$$hgtFilePath" || true ) - # this silences deprecation warnings in Ortho4XP for more concise output - @set -e;\ - export COORDS=$$(echo $(@) | sed -e 's/.*\/\([-+][0-9]\+\)\([-+][0-9]\+\).dsf/\1 \2/g');\ + @# this silences deprecation warnings in Ortho4XP for more concise output + @set -e; \ + export COORDS=$$(echo $(@) | sed -e 's/.*\/\([-+][0-9]\+\)\([-+][0-9]\+\).dsf/\1 \2/g'); \ cd Ortho4XP \ - && python3 Ortho4XP.py $$COORDS BI $(ZL) 2>&1 \ - || ( \ + && python3 Ortho4XP.py $$COORDS BI $(ZL) 2>&1; \ + [ -e Tiles/*/*/*/$*.dsf ] || ( \ echo "ERROR DETECTED! Retry tile $@ with noroads config."; \ cp $(CURDIR)/Ortho4XP_noroads.cfg $(CURDIR)/Ortho4XP/Tiles/zOrtho4XP_$*/Ortho4XP_$*.cfg \ && python3 Ortho4XP.py $$COORDS BI $(ZL) 2>&1 \ - ); + ) + @[ -e Ortho4XP/Tiles/*/*/*/$*.dsf ] \ + && PIPENV_PIPFILE=./otv/Pipfile pipenv run ./otv/bin/otv --all --ignore-textures "$$(dirname Ortho4XP/Tiles/*/*/*/$*.dsf)/../.." var/run/z_ao__single_%: Ortho4XP/Tiles/*/*/*/%.dsf @echo "[$@]"