Skip to content

Commit

Permalink
test tiles with otv (thanks @dyoung522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaseberle committed Dec 6, 2024
1 parent be5b521 commit eecf835
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*~
*.swp
Ortho4XP
/Ortho4XP/
/otv/
*_tile_list.*
/var/
/.venv/
Expand Down
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
#
Expand Down Expand Up @@ -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"
Expand All @@ -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 "[$@]"
Expand Down

0 comments on commit eecf835

Please sign in to comment.