[gdal-dev] Apply filter on VRT

Chaitanya kumar CH chaitanya.ch at gmail.com
Thu Apr 12 08:54:04 EDT 2012


Saâd,

There should be a Kernel element in a KernelFilteredSource.
FYI, all the pixels whose kernel has a nodata pixel will be reported as a
nodata pixel.

On Wed, Apr 11, 2012 at 3:20 PM, Saâd HESSANE <saad.hessane at gmail.com>wrote:

> Hy all,
>
> I have a VRT file generated with buildvrt utility :
>
> <VRTDataset rasterXSize="52436" rasterYSize="32400">
>>   <SRS>...</SRS>
>>   <GeoTransform>...</GeoTransform>
>>   <VRTRasterBand dataType="UInt16" band="1">
>>     <NoDataValue>0</NoDataValue>
>>     <ColorInterp>Gray</ColorInterp>
>>     <ComplexSource>
>>       <SourceFilename relativeToVRT="1">1.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="8449" RasterYSize="6429"
>> DataType="UInt16" BlockXSize="8449" BlockYSize="1" />
>>       <SrcRect xOff="0" yOff="0" xSize="8449" ySize="6429" />
>>       <DstRect xOff="0" yOff="0" xSize="10721" ySize="8158" />
>>       <NODATA>0</NODATA>
>>     </ComplexSource>
>>     <ComplexSource>
>>       <SourceFilename relativeToVRT="1">2.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="8772" RasterYSize="6407"
>> DataType="UInt16" BlockXSize="8772" BlockYSize="1" />
>>       <SrcRect xOff="0" yOff="0" xSize="8772" ySize="6407" />
>>       <DstRect xOff="43664" yOff="25993" xSize="8772" ySize="6407" />
>>       <NODATA>0</NODATA>
>>     </ComplexSource>
>>   </VRTRasterBand>
>> </VRTDataset>
>>
>
> It's work fine with a gdal_translate.
> Now I want to apply a filter kernel to the VRT. I have to use the
> KernelFilteredSource.
> The gdal api say that VRTKernelFilteredSource is a sub-class of
> VRTComplexSource. So a VRTKernelFilteredSource *is *a VRTComplexSource.
> But if I replace VRTComplexSource by VRTKernelFilteredSource,
> gdal_translate crash. This is the new VRT :
>
> <VRTDataset rasterXSize="52436" rasterYSize="32400">
>>   <SRS>...</SRS>
>>   <GeoTransform>...</GeoTransform>
>>   <VRTRasterBand dataType="UInt16" band="1">
>>     <NoDataValue>0</NoDataValue>
>>     <ColorInterp>Gray</ColorInterp>
>>     <KernelFilteredSource>
>>       <SourceFilename relativeToVRT="1">1.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="8449" RasterYSize="6429"
>> DataType="UInt16" BlockXSize="8449" BlockYSize="1" />
>>       <SrcRect xOff="0" yOff="0" xSize="8449" ySize="6429" />
>>       <DstRect xOff="0" yOff="0" xSize="10721" ySize="8158" />
>>       <NODATA>0</NODATA>
>>     </KernelFilteredSource>
>>     <KernelFilteredSource>
>>       <SourceFilename relativeToVRT="1">2.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="8772" RasterYSize="6407"
>> DataType="UInt16" BlockXSize="8772" BlockYSize="1" />
>>       <SrcRect xOff="0" yOff="0" xSize="8772" ySize="6407" />
>>       <DstRect xOff="43664" yOff="25993" xSize="8772" ySize="6407" />
>>       <NODATA>0</NODATA>
>>     </KernelFilteredSource>
>>   </VRTRasterBand>
>> </VRTDataset>
>>
>
> It's weird, I expected a polymorphism between VRTComplexSource and
> VRTKernelFilteredSource.
> So the question : how can I apply a filter to a VRT?
> Thank you !
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120412/da204eb3/attachment-0001.html


More information about the gdal-dev mailing list