<div dir="ltr"><div dir="ltr">Hi Denis, Even,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 27, 2020 at 8:08 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">On jeudi 27 août 2020 15:08:02 CEST Denis Rykov wrote:</p>
<p style="margin:0px;text-indent:0px">> I found the culprit. If remove this section from each band definition in</p>
<p style="margin:0px;text-indent:0px">> VRT file then everything works fine:</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> <ComplexSource></p>
<p style="margin:0px;text-indent:0px">>      <SourceFilename relativeToVRT="1" shared="0">dummy.tif</SourceFilename></p>
<p style="margin:0px;text-indent:0px">>      <SourceBand>3</SourceBand></p>
<p style="margin:0px;text-indent:0px">>      <SourceProperties BlockXSize="128" BlockYSize="128"</p>
<p style="margin:0px;text-indent:0px">> RasterXSize="40961" RasterYSize="139265" dataType="Byte" /></p>
<p style="margin:0px;text-indent:0px">>      <SrcRect xOff="0" xSize="1" yOff="0" ySize="1" /></p>
<p style="margin:0px;text-indent:0px">>      <DstRect xOff="0" xSize="1" yOff="0" ySize="1" /></p>
<p style="margin:0px;text-indent:0px">>      <ScaleRatio>0</ScaleRatio></p>
<p style="margin:0px;text-indent:0px">>      <ScaleOffset>0.0</ScaleOffset></ComplexSource</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">I'm perhaps missing something, but the above snippet added by RasterIO doesn't make sense to me. It just sets the pixel at (0,0) to 0. I bet it is completely useless. It would make more sense to have xSize/ySize of DstRect to cover the whole raster. And as <NoDataValue> is set on the VRTRasterBand, this should be used to fill the target raster anyway.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">As far as why overviews of the original VRT aren't used is concerned, I'm not sure why. I'd have expected it to work, but I must be missing something.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p></div></blockquote><div><br></div><div>That's a rasterio bug: the background "dummy.tif" source should be <DstRect xOff="0" xSize="40961" yOff="0" ySize="139265" />. I'm working on a patch for this.</div><div><br></div><div>This VRT background fill is different from nodata. The scale offset could be different from the nodata value. BTW, It takes advantage of GDAL shortcuts predicated on scale ratio. The "dummy.tif" file is never opened and doesn't even exist. </div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div>