[gdal-dev] Overviews are not taken into account while reading with specified resampling method

Sean Gillies sean at mapbox.com
Thu Aug 27 09:38:39 PDT 2020


Hi Denis, Even,

On Thu, Aug 27, 2020 at 8:08 AM Even Rouault <even.rouault at spatialys.com>
wrote:

> On jeudi 27 août 2020 15:08:02 CEST Denis Rykov wrote:
>
> > I found the culprit. If remove this section from each band definition in
>
> > VRT file then everything works fine:
>
> >
>
> > <ComplexSource>
>
> > <SourceFilename relativeToVRT="1" shared="0">dummy.tif</SourceFilename>
>
> > <SourceBand>3</SourceBand>
>
> > <SourceProperties BlockXSize="128" BlockYSize="128"
>
> > RasterXSize="40961" RasterYSize="139265" dataType="Byte" />
>
> > <SrcRect xOff="0" xSize="1" yOff="0" ySize="1" />
>
> > <DstRect xOff="0" xSize="1" yOff="0" ySize="1" />
>
> > <ScaleRatio>0</ScaleRatio>
>
> > <ScaleOffset>0.0</ScaleOffset></ComplexSource
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> Even
>

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.

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.

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200827/9ec4400b/attachment.html>


More information about the gdal-dev mailing list