[gdal-dev] VRT KernelFilteredSource and overviews
Even Rouault
even.rouault at spatialys.com
Thu Oct 5 03:26:46 PDT 2017
On mercredi 4 octobre 2017 11:11:28 CEST Rahkonen Jukka (MML) wrote:
> Hi,
>
> I was playing with kernel filters in VRT and using this really applies
> sharpen filter on-the-fly when looking the image at native resolution with
> QGIS:
>
> <VRTRasterBand dataType="Byte" band="1">
> <ColorInterp>Red</ColorInterp>
> <KernelFilteredSource>
> <SourceFilename relativeToVRT="1">image.tif</SourceFilename>
> <SourceBand>1</SourceBand>
> <SourceProperties RasterXSize="12000" RasterYSize="12000"
> DataType="Byte" BlockXSize="12000" BlockYSize="1" /> <SrcRect xOff="0"
> yOff="0" xSize="12000" ySize="12000" />
> <DstRect xOff="0" yOff="0" xSize="12000" ySize="12000" />
> <Kernel normalized="0">
> <Size>3</Size>
> <Coefs>0 -1 0 -1 5 -1 0 -1 0</Coefs>
> </Kernel>
> </KernelFilteredSource>
> </VRTRasterBand>
>
> However, filter is not applied to overviews which means that image looks
> different when I zoom out. Is this the intended behavior?
I guess not from a user point of view. But looking at the code, I see:
/* -------------------------------------------------------------------- */
/* For now we don't support filtered access to non-full */
/* resolution requests. Just collect the data directly without */
/* any operator. */
/* -------------------------------------------------------------------- */
if( nBufXSize != nXSize || nBufYSize != nYSize )
{
return VRTComplexSource::RasterIO( nXOff, nYOff, nXSize, nYSize,
pData, nBufXSize, nBufYSize,
eBufType, nPixelSpace, nLineSpace,
psExtraArg );
}
(which means that over-sampling will also not apply the kernel)
So seems the issue is "known". Probably that documenting this limitation should be done for
now.
Doc source is in frmts/vrt/vrt_tutorial.dox
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171005/6d9c56dc/attachment.html>
More information about the gdal-dev
mailing list