bopen / elevation

Python script to download global terrain digital elevation models, SRTM 30m DEM and SRTM 90m DEM.
http://elevation.bopen.eu
Apache License 2.0
290 stars 74 forks source link

Empty/invalid SRTM 3 sec files being downloaded when the difference between bounds' latitude and 64 is less than 5 #53

Closed Achaad closed 2 years ago

Achaad commented 2 years ago

I need to acquire SRTM 3 DEM files for the following bounds: [25.50965297 58.40783034 27.67946847 60.06743426]. As the top right corner's latitude is 60, elevation downloads srtm_42_00.tif file, and as there is no such file on the datasource, an empty file is being created. The problem lies in srtm3_tile_ilonlat(lon, lat) function in datasource.py:53

return (ilon + 180) // 5 + 1, (64 - ilat) // 5

One possible would be to check if the file exists, and only then download it.