Closed Julien-Osman closed 5 years ago
It appears that urllib.request.urlretrieve
is legacy, so it might become deprecated at some point. Moreover, it is not compatible with python2. A solution to both those issues is to use the request
module, but it would add a dependency. What do you prefer ?
Hi Julien,
Thanks for the addition. I propose to solve it using a simple try-except block around the import:
try:
from urllib.request import urlretrieve
except:
from urllib import urlretrieve
This is not beautiful, but at least this will add backwards-compatibility to python2.
Peter
This PR addresses an issue with prepare_dtm. Indeed, with the current version of prepare_dtm, if a SRTM file is not found, the program stops. This is fine when working with one product/tile, but when someone wants to run a script that calls prepare_dtm over a large number of products/tiles it becomes a problem. The solution I propose is to download the missing SRTM files directly from the CGIAR website. Then, the program stops only if the file can't be download.