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

Modified Makefile template to preserve ESRI World Files (.tfw) #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion elevation/datasource.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
DATASOURCE_URL := {datasource_url}
PRODUCT := {product}
TILE_EXT := {tile_ext}
FTW_EXT := .tfw
COMPRESSED_PRE_EXT = {compressed_pre_ext}
COMPRESSED_EXT := {compressed_ext}

ENSURE_TILE_PATHS := $(foreach n,$(ENSURE_TILES),cache/$n)
STDERR_SWITCH := 2>/dev/null

$(info DEM files covered $(ENSURE_TILES))

all: $(PRODUCT).vrt

$(PRODUCT).vrt: $(shell find cache -size +0 -name "*.tif" 2>/dev/null)
Expand All @@ -18,7 +21,8 @@ spool/%$(COMPRESSED_EXT):
curl -s -o [email protected] $(DATASOURCE_URL)/$*$(COMPRESSED_EXT) && mv [email protected] $@

spool/%$(TILE_EXT): spool/%$(COMPRESSED_PRE_EXT).zip
unzip -qq -d spool $< $*$(TILE_EXT) $(STDERR_SWITCH) || touch $@
unzip -qq -d spool $< $*$(TILE_EXT) $*$(FTW_EXT) $(STDERR_SWITCH) || touch $@
mv spool/$*$(FTW_EXT) cache/

spool/%$(TILE_EXT): spool/%$(COMPRESSED_PRE_EXT).gz
gunzip $< $(STDERR_SWITCH) || touch $@
Expand All @@ -43,6 +47,7 @@ info:

clean:
find cache -size 0 -name "*.tif" -delete
find cache -size 0 -name "*.tfw" -delete
$(RM) $(PRODUCT).*.vrt
$(RM) -r spool/*

Expand Down