bopen / elevation

Python script to download global terrain digital elevation models, SRTM 30m DEM and SRTM 90m DEM.

Home Page:http://elevation.bopen.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option to keep .hgt files

scottstanie opened this issue · comments

Hi I really like this project and how usable it is.
I have a use case right now where I want to keep the .hgt files from a polygon rather than turn them into the geotiff files. I see in the makefile that it cleans them up the files in spool with a rm after converting and storing in the cache directory.
Is there already an to stop this removal, or would I need to just edit the makefile?

@scottstanie looks like this is make removing intermediate files and I didn't find a simple way to tell it not to do it without changing the code.

Your best bet is to identify the cache folder with eio info and modifying the Makefile there to add:

.SECONDARY:

See: https://stackoverflow.com/questions/9638275/how-to-undo-intermediate-file-deletion

I'd suggest one of the ways to do so as I did in my fork for keeping .ftw files - https://github.com/svenKautlenbach/elevation/blob/master/elevation/datasource.mk
One should modify spool target

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

Optionally there could be also additional $*$(HGT_EXT)
Please be mind that one should add those types of files to be deleted too in clean target

Would @alexamici accept these modifications if I'd make a proper pull request?