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