[gdal-dev] KernelFilteredSource and nodata

Chaitanya kumar CH chaitanya.ch at gmail.com
Thu Nov 18 00:10:31 EST 2010


Ken,

The current kernel filter does not ignore the boundaries of nodata pixels.
But it does normalize the kernel after ignoring the nodata pixels in the
kernel, if the 'normalized' attribute is set to 1.

You can raise a ticket to request for this feature at
http://trac.osgeo.org/gdal/newticket


On Thu, Nov 18, 2010 at 6:08 AM, Boss, Ken (DNR) <Ken.Boss at state.mn.us>wrote:

> Hello list--
>
> I am attempting to filter a raster using gdal_translate (v 1.7) and a vrt
> with a KernelFilteredSource.  The input raster contains large areas of
> "nodata" values.  I would like the filter to ignore those areas.  I have
> tried various combinations of <NoDataValue>, <HideNoDataValue>, <NODATA> and
> <Kernel normalized='1'>, but have not been able to prevent the filter from
> applying itself at data/nodata boundaries.
>
> My current VRT and gdal_translate command lines are below.  Can anyone tell
> me what I am doing wrong?
>
> Thanks,
>
> Ken Boss
> Minnesota DNR
>
> ===== kernel_filter.vrt ===================
>
> <VRTDataset rasterYSize='690' rasterXSize='575'>
>  <SRS>EPSG:26915</SRS>
>  <GeoTransform>190000, 1000, 0, 4795000, 0, 1000</GeoTransform>
>  <VRTRasterBand band='1' dataType='Byte'>
>    <KernelFilteredSource>
>      <SourceFilename>interpolated.tif</SourceFilename>
>      <SourceBand>1</SourceBand>
>      <NoDataValue>255</NoDataValue>
>      <HideNoDataValue>1</HideNoDataValue>
>      <Kernel normalized='1'>
>        <Size>5</Size>
>        <Coefs>0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04
> 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04</Coefs>
>      </Kernel>
>    </KernelFilteredSource>
>  </VRTRasterBand>
> </VRTDataset>
>
> =====================================
>
> gdal_translate -of GTiff -ot Byte -a_srs EPSG:26915 kernel_filter.vrt
> kernel_filtered.tif
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101118/26b768cd/attachment.html


More information about the gdal-dev mailing list