Skip to content
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 $@.temp $(DATASOURCE_URL)/$*$(COMPRESSED_EXT) && mv $@.temp $@

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