<div dir="ltr">Hi,<br clear="all"><div><br>I have prepared a python script that uses gdalwarp to mosaic and resample ASTER DEM tiles, using as arguments the bounding box lat/lon coordinates and the width and height of the output Gtiff. It works fine, except when I use a quite large bbox (e.g. whole of Europe) where I get the gdal errors I include below. If I split my bbox in two and iteratively run the script there are no errors, all the tiffs are recognized without any issues, and the process completes successfully. Do you know what can cause this weird problem? Is it because of gdal or the OS?<br> <br>The bbox coords (latS, lonW, latN, LonE) and the width and height that gives me these errors are (29.94, -10.55, 61.18, 31.38), 4194 and 3125, respectively.</div><div><br></div><div>I use python 3.6.7, gdal 2.2.3 and Ubuntu 18.04.4.</div><div><br></div><div>Thank you in advance for your help!<br></div><div><br></div><div>Errors:</div><div>=====<br></div><div>    ERROR 4: `/vsizip//DATA/ASTER_GDEM_v3/ASTGTMV003_N45E009.zip/ASTGTMV003_N45E009_dem.tif' not recognized as a supported file format.<br>    ERROR 4: `/vsizip//DATA/ASTER_GDEM_v3/ASTGTMV003_N54E011.zip/ASTGTMV003_N54E011_dem.tif' not recognized as a supported file format.<br>    ERROR 4: `/vsizip//DATA/ASTER_GDEM_v3/ASTGTMV003_N34E033.zip/ASTGTMV003_N34E033_dem.tif' not recognized as a supported file format.<br>    ERROR 4: `/vsizip//DATA/ASTER_GDEM_v3/ASTGTMV003_N48E019.zip/ASTGTMV003_N48E019_dem.tif' not recognized as a supported file format.<br>    ERROR 4: `/vsizip//DATA/ASTER_GDEM_v3/ASTGTMV003_N51E006.zip/ASTGTMV003_N51E006_dem.tif' not recognized as a supported file format.<br>    Traceback (most recent call last):<br>      File "/home/USER/gdalwarp_ASTGTM_tiles_inside_bbox.py", line 127, in <module><br>        warp_ASTGTM_tiles(args.savename, args.bbox, args.width, args.height, args.method)<br>      File "/home/USER/gdalwarp_ASTGTM_tiles_inside_bbox.py", line 107, in warp_ASTGTM_tiles<br>        gdal.Warp(savename, DEM_tiles_bbox, options=warp_options)<br>      File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 580, in Warp<br>        return wrapper_GDALWarpDestName(destNameOrDestDS, srcDSTab, opts, callback, callback_data)<br>      File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 3112, in wrapper_GDALWarpDestName<br>        return _gdal.wrapper_GDALWarpDestName(*args)<br>    SystemError: <built-in function wrapper_GDALWarpDestName> returned NULL without setting an error<br><br><br>My function is the following:</div><div>===================</div><div><br></div><div>def warp_ASTGTM_tiles(savename, bbox, width, height, resampling_method):<br><br>    bound_S = math.trunc(bbox[0])<br>    bound_W = math.trunc(bbox[1])<br>    bound_N = math.ceil(bbox[2])<br>    bound_E = math.ceil(bbox[3])<br><br>    ASTGTM_zips = Path(ASTGTM_DATADIR).glob("*.zip")<br><br>    ASTGTM_zips_bbox = []<br><br>    for zipf in ASTGTM_zips:<br>        if re.match(ASTGTM_REGX, <a href="http://zipf.name">zipf.name</a>):<br>            tile_lat, tile_lon = get_tile_loc(<a href="http://zipf.name">zipf.name</a>)<br>            if (tile_lat >= bound_S and tile_lat <= bound_N and<br>                tile_lon >= bound_W and tile_lon <= bound_E):<br>                ASTGTM_zips_bbox.append(zipf)<br>    <br>    if len(ASTGTM_zips_bbox) == 0:<br>        raise SystemExit("No tiles are available for given bbox")<br><br>    DEM_tiles_bbox = []<br>    <br>    for zipf in ASTGTM_zips_bbox:<br>        with zipfile.ZipFile(zipf, "r") as zp:<br>            dem = zipf.stem + "_dem.tif"<br>            DEM_tiles_bbox.append(gdal.Open(f"/vsizip/{str(zipf)}/{dem}"))<br><br>    warp_options = gdal.WarpOptions(<br>        format="GTiff",<br>        outputBounds=(bbox[1], bbox[0], bbox[3], bbox[2]),<br>        outputBoundsSRS=WGS84_PROJ,<br>        srcSRS=DEM_tiles_bbox[0].GetProjection(),<br>        dstSRS=WGS84_PROJ,<br>        width=width,<br>        height=height,<br>        srcNodata=0,<br>        dstNodata=0,<br>        resampleAlg=METHODS[resampling_method],<br>    )  <br>    <br>    gdal.Warp(savename, DEM_tiles_bbox, options=warp_options)<br><br><br></div></div>