[gdal-dev] ERROR when requesting raster data outside coverage of VRT
caboe at sdfe.dk
Wed Apr 26 03:43:45 PDT 2017
Thanks for your reply. I think I get it now.
Well, a VRT dataset is a GDAL dataset, so there's no difference from API usage when requesting a VRT or a GeoTIFF
You can use ds.RasterXSize / ds.RasterYSize to know the VRT dimensions and check if x + width > ds.RasterXSize or y + height > ds.RasterYSize
Okay, so as long as I stay within the VRT bbox I can request data. If I request data inside the VRT bbox even though it doesn't have GeoTIFF coverage there, I will still get a result (consisting of zeros)?
This is indeed a conveniency of gdal_translate itself. Using ReadAsArray() you must stick to the dataset dimensions.
And I find it very convenient :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev