<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thank you very much Even. I will try it then and confirm our understanding!<br><br>With best regards.<br>~Belaid Moa.<br><br>&gt; Date: Sun, 30 Aug 2009 22:29:33 +0200<br>&gt; From: even.rouault@mines-paris.org<br>&gt; To: belaid_moa@hotmail.com<br>&gt; CC: even.rouault@mines-paris.org; gdal-dev@lists.osgeo.org<br>&gt; Subject: RE: [gdal-dev] VRT KernelFilteredSource and NoDataValue<br>&gt; <br>&gt; Selon Belaid MOA &lt;belaid_moa@hotmail.com&gt;:<br>&gt; <br>&gt; &gt;<br>&gt; &gt; As always, thank you very ... very much Even. Just to make sure I understood<br>&gt; &gt; your reply correctly,<br>&gt; &gt; I do the following to set the source_0 and the nodatavalue (passed as<br>&gt; &gt; argument)<br>&gt; &gt; after creating the XML for the VRTKernelFilteredSource and set it in the<br>&gt; &gt; papszMetadata array.<br>&gt; &gt; The poBand is the RasterBand I get from the VRT dataset.<br>&gt; &gt;<br>&gt; &gt;       poBand-&gt;SetNoDataValue(noDataValue);<br>&gt; &gt;       poBand-&gt;SetMetadata( papszMetadata, "vrt_sources" );<br>&gt; &gt;<br>&gt; &gt; Is this right place to set the NoDataValue of the VRTRasterBand?<br>&gt; &gt;<br>&gt; &gt; For the normalization effect (normalized=1), does it mean that:<br>&gt; &gt; 1- The no data value pixels are ignored AND<br>&gt; &gt; 2- The coefficients of valid pixels only are adjusted so that their sum  is<br>&gt; &gt; equal to 1?<br>&gt; <br>&gt; Yes, correct. Well, that's my understanding of the code : no warranty expressed<br>&gt; or implied ;-) I guess you just have now to try<br>&gt; <br>&gt; &gt; If this is the case, then it is exactly the behavior I want!<br>&gt; &gt;<br>&gt; &gt; With best regards.<br>&gt; &gt; ~Belaid.<br>&gt; &gt;<br>&gt; &gt; &gt; Date: Sun, 30 Aug 2009 10:12:04 +0200<br>&gt; &gt; &gt; From: even.rouault@mines-paris.org<br>&gt; &gt; &gt; To: belaid_moa@hotmail.com<br>&gt; &gt; &gt; CC: gdal-dev@lists.osgeo.org<br>&gt; &gt; &gt; Subject: Re: [gdal-dev] VRT KernelFilteredSource and NoDataValue<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Selon Belaid MOA &lt;belaid_moa@hotmail.com&gt;:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Belaid,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; First, the VRTKernelFilteredSource will only recognize the nodata value if<br>&gt; &gt; you<br>&gt; &gt; &gt; set it on the VRTRasterBand (it will not fetch it directly from the<br>&gt; &gt; &gt; &lt;SourceFilename&gt;)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; When a nodata value is set and found in one of the values in a NxN square,<br>&gt; &gt; the<br>&gt; &gt; &gt; value will be ignored. The effect of this depends whether normalized="1" is<br>&gt; &gt; set<br>&gt; &gt; &gt; on &lt;Kernel&gt; or not. If normalized=1, the sum of the coefficients is not<br>&gt; &gt; &gt; incremented for that nodata value, so the normalization will operate only<br>&gt; &gt; on<br>&gt; &gt; &gt; valid pixel values. If normalized=0, the nodata value is just ignored<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; As far as what happens in the borders is concerned, the code says that :<br>&gt; &gt; "Fill<br>&gt; &gt; &gt; in missing areas.  Note that we replicate the edge valid values out.  We<br>&gt; &gt; don't<br>&gt; &gt; &gt; using "mirroring" which might be more suitable for some times of filters.<br>&gt; &gt; We<br>&gt; &gt; &gt; also don't mark these pixels as "nodata" though perhaps we should."<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Best regards,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Even<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; Hi everyone,<br>&gt; &gt; &gt; &gt;     I am using VRT KernelFilteredSource to implement an average filter as<br>&gt; &gt; &gt; &gt; done in the VRT tutorial. However, I am still unclear on how it handles<br>&gt; &gt; the<br>&gt; &gt; &gt; &gt; NoDataValue pixels. Are they too averaged or does it leave them as they<br>&gt; &gt; are?<br>&gt; &gt; &gt; &gt; If they are masked,  does do an adjustment for the kernel coefficients to<br>&gt; &gt; &gt; &gt; compensate for their absence? Another related question, is how does it<br>&gt; &gt; handle<br>&gt; &gt; &gt; &gt; the pixels on the borders and the kernel coefficients for those pixels?<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;    Thank you very very much in advance for any help on these issues.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;    With best regards.<br>&gt; &gt; &gt; &gt; ~Belaid.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; _________________________________________________________________<br>&gt; &gt; &gt; &gt; Stay on top of things, check email from other accounts!<br>&gt; &gt; &gt; &gt; http://go.microsoft.com/?linkid=9671355<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt; _________________________________________________________________<br>&gt; &gt; Click less, chat more: Messenger on MSN.ca<br>&gt; &gt; http://go.microsoft.com/?linkid=9677404<br>&gt; <br>&gt; <br><br /><hr />Click less, mail more: Hotmail on the new <a href='http://go.microsoft.com/?linkid=9677402' target='_new'>MSN homepage!</a></body>
</html>