Saâd,<br><br>There should be a Kernel element in a KernelFilteredSource.<br>FYI, all the pixels whose kernel has a nodata pixel will be reported as a nodata pixel.<br><br><div class="gmail_quote">On Wed, Apr 11, 2012 at 3:20 PM, Saâd HESSANE <span dir="ltr">&lt;<a href="mailto:saad.hessane@gmail.com">saad.hessane@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hy all,<br><br>I have a VRT file generated with buildvrt utility :<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
&lt;VRTDataset rasterXSize=&quot;52436&quot; rasterYSize=&quot;32400&quot;&gt;<br>
  &lt;SRS&gt;...&lt;/SRS&gt;<br>  &lt;GeoTransform&gt;...&lt;/GeoTransform&gt;<br>  &lt;VRTRasterBand dataType=&quot;UInt16&quot; band=&quot;1&quot;&gt;<br>    &lt;NoDataValue&gt;0&lt;/NoDataValue&gt;<br>    &lt;ColorInterp&gt;Gray&lt;/ColorInterp&gt;<br>

    &lt;ComplexSource&gt;<br>      &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;1.tif&lt;/SourceFilename&gt;<br>      &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>      &lt;SourceProperties RasterXSize=&quot;8449&quot; RasterYSize=&quot;6429&quot; DataType=&quot;UInt16&quot; BlockXSize=&quot;8449&quot; BlockYSize=&quot;1&quot; /&gt;<br>

      &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;8449&quot; ySize=&quot;6429&quot; /&gt;<br>      &lt;DstRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;10721&quot; ySize=&quot;8158&quot; /&gt;<br>

      &lt;NODATA&gt;0&lt;/NODATA&gt;<br>    &lt;/ComplexSource&gt;<br>    &lt;ComplexSource&gt;<br>      &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;2.tif&lt;/SourceFilename&gt;<br>      &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>

      &lt;SourceProperties RasterXSize=&quot;8772&quot; RasterYSize=&quot;6407&quot; DataType=&quot;UInt16&quot; BlockXSize=&quot;8772&quot; BlockYSize=&quot;1&quot; /&gt;<br>      &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;8772&quot; ySize=&quot;6407&quot; /&gt;<br>

      &lt;DstRect xOff=&quot;43664&quot; yOff=&quot;25993&quot; xSize=&quot;8772&quot; ySize=&quot;6407&quot; /&gt;<br>      &lt;NODATA&gt;0&lt;/NODATA&gt;<br>    &lt;/ComplexSource&gt;<br>  &lt;/VRTRasterBand&gt;<br>&lt;/VRTDataset&gt;<br>

</blockquote><div><br>It&#39;s work fine with a gdal_translate.<br>Now I want to apply a filter kernel to the VRT. I have to use the KernelFilteredSource.<br>The gdal api say that VRTKernelFilteredSource is a sub-class of VRTComplexSource. So a VRTKernelFilteredSource <b>is </b>a VRTComplexSource.<br>

But if I replace VRTComplexSource by VRTKernelFilteredSource, gdal_translate crash. This is the new VRT :<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">

&lt;VRTDataset rasterXSize=&quot;52436&quot; rasterYSize=&quot;32400&quot;&gt;<br>  &lt;SRS&gt;...&lt;/SRS&gt;<br>  &lt;GeoTransform&gt;...&lt;/GeoTransform&gt;<br>  &lt;VRTRasterBand dataType=&quot;UInt16&quot; band=&quot;1&quot;&gt;<br>

    &lt;NoDataValue&gt;0&lt;/NoDataValue&gt;<br>    &lt;ColorInterp&gt;Gray&lt;/ColorInterp&gt;<br>    &lt;KernelFilteredSource&gt;<br>      &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;1.tif&lt;/SourceFilename&gt;<br>

      &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>      &lt;SourceProperties RasterXSize=&quot;8449&quot; RasterYSize=&quot;6429&quot; DataType=&quot;UInt16&quot; BlockXSize=&quot;8449&quot; BlockYSize=&quot;1&quot; /&gt;<br>

      &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;8449&quot; ySize=&quot;6429&quot; /&gt;<br>      &lt;DstRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;10721&quot; ySize=&quot;8158&quot; /&gt;<br>

      &lt;NODATA&gt;0&lt;/NODATA&gt;<br>    &lt;/KernelFilteredSource&gt;<br>    &lt;KernelFilteredSource&gt;<br>      &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;2.tif&lt;/SourceFilename&gt;<br>      &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>

      &lt;SourceProperties RasterXSize=&quot;8772&quot; RasterYSize=&quot;6407&quot; DataType=&quot;UInt16&quot; BlockXSize=&quot;8772&quot; BlockYSize=&quot;1&quot; /&gt;<br>      &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;8772&quot; ySize=&quot;6407&quot; /&gt;<br>

      &lt;DstRect xOff=&quot;43664&quot; yOff=&quot;25993&quot; xSize=&quot;8772&quot; ySize=&quot;6407&quot; /&gt;<br>      &lt;NODATA&gt;0&lt;/NODATA&gt;<br>    &lt;/KernelFilteredSource&gt;<br>  &lt;/VRTRasterBand&gt;<br>

&lt;/VRTDataset&gt;<br></blockquote><div><br>It&#39;s weird, I expected a polymorphism between VRTComplexSource and VRTKernelFilteredSource.<br>So the question : how can I apply a filter to a VRT?<br>Thank you !<br></div>

</div><br>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>
<br>+91-9494447584<br>17.2416N 80.1426E<br>