<p dir="ltr">Hi all</p>
<p dir="ltr">I am experiencing problems using a VRT dataset built from a large directory of .tif files.</p>
<p dir="ltr">While if a build the VRT from just one of these datasets, gdalwarp will work very fast with it, if I use the VRT will all of these images, it becomes undefinite times slower.</p>
<p dir="ltr">Debugging the gdalwarp command, it seems that gdalwarp accesses every single raster composing the vrt datasource, even if that single raster is not within the extent defined by the -te gdalwarp option.</p>
<p dir="ltr">Here is the output for a vrt composed by just one single .tif file:</p>
<p dir="ltr">$ time gdalwarp -te -88.88 20.28 -87.88 21.28 single.vrt single.tiff<br>
...<br>
Src=1344,4463,1201x1201 Dst=0,0,1200x1200<br>
0...10...20...30...40...50...60...70...80...90...100 - done.<br>
GDAL: GDALClose(single.vrt, this=0x8ca6ef8)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_19_08.tif, this=0x8ca9aa8)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_19_08.tif, this=0x8ca7208)<br>
GDAL: GDALClose(single.tiff, this=0x8ca7e98)<br>
GDAL: In GDALDestroy - unloading GDAL shared library.</p>
<p dir="ltr">real 0m0.137s<br>
user 0m0.076s<br>
sys 0m0.052s</p>
<p dir="ltr">and here is the output for a vrt composed of all of the .tif files:</p>
<p dir="ltr">capooti@ubuntu:~/training/vrt$ time gdalwarp -te -88.88 20.28 -87.88 21.28 all.vrt all.tiff<br>
...<br>
Src=7344,16464,1201x1201 Dst=0,0,1200x1200<br>
0...10...20...30...40...50...60...70...80...90...100 - done.<br>
GDAL: GDALClose(all.vrt, this=0x9d332b0)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_18_09.tif, this=0x9d46618)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_19_08.tif, this=0x9d467c8)<br>
...<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_35_09.tif, this=0x9d4c1b8)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_35_10.tif, this=0x9d4c3a8)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_19_08.tif, this=0x9d30800)<br>
GDAL: GDALClose(/home/capooti/training/vrt/srtm_35_11.tif, this=0x9d4c630)<br>
GDAL: GDALClose(all.tiff, this=0x9d33990)<br>
GDAL: In GDALDestroy - unloading GDAL shared library.</p>
<p dir="ltr">real 61m12.130s<br>
user 0m6.076s<br>
sys 0m18.052s</p>
<p dir="ltr">Any hint here to prevent gdalwarp to access the unneeded source raster files - the defined extent in -te should just hit a couple of ones?<br>
thanks in advance<br>
p</p>
<p dir="ltr">-- <br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti</p>