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

dem.py error because of wrong filename of unzipped SRTM tile (mostly over water) #750

Open
falkamelung opened this issue Aug 8, 2023 · 0 comments · May be fixed by #751
Open

dem.py error because of wrong filename of unzipped SRTM tile (mostly over water) #750

falkamelung opened this issue Aug 8, 2023 · 0 comments · May be fixed by #751
Labels
bug Something isn't working

Comments

@falkamelung
Copy link
Contributor

dem.py can give an error because of wrong name of unzipped tile. For example

dem.py -a stitch --filling --filling_value 0 -b 37 39 48 51 -c -u https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/

says:

Cannot open DEM file ./N38E050.hgt for reading.
API open (R): ./demLat_N37_N39_Lon_E048_E051.dem
API close:  ./demLat_N37_N39_Lon_E048_E051.dem
Writing geotrans to VRT for ./demLat_N37_N39_Lon_E048_E051.dem
GDAL open (R): ./demLat_N37_N39_Lon_E048_E051.dem.vrt
ERROR 1: Invalid dataset dimensions : 10800 x -1
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot open the file ./demLat_N37_N39_Lon_E048_E051.dem.vrt in read mode.
Aborted

It does not find the file N38E050.hgt. The reason is that N38E050.SRTMGL1.hgt.zip unzips to N38E050.SRTMGL1.hgt instead of N38E050.hgt:

unzip N38E050.SRTMGL1.hgt.zip
Archive:  N38E050.SRTMGL1.hgt.zip
  inflating: N38E050.SRTMGL1.hgt

unzip N38E049.SRTMGL1.hgt.zip
Archive:  N38E049.SRTMGL1.hgt.zip
  inflating: N38E049.hgt

This gets clear from the listing of unzipped files:

 ls -l *hgt
-rw-r--r-- 1 tg851601 G-820134 25934402 Oct  8  2012 N37E048.hgt
-rw-r--r-- 1 tg851601 G-820134 25934402 Oct  8  2012 N38E048.hgt
-rw-r--r-- 1 tg851601 G-820134 25934402 Oct  8  2012 N38E049.hgt
-rw-r--r-- 1 tg851601 G-820134 25934402 Aug 10  2015 N38E050.SRTMGL1.hgt

This seems to happen primarily (possibly only) over water.

I will submit a PR that renames the unzipped tile if needed (N38E050.SRTMGL1.hgt to N38E050.hgt).

@rtburns-jpl rtburns-jpl added the bug Something isn't working label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants