[gdal-dev] KernelFilteredSource and nodata
Boss, Ken (DNR)
Ken.Boss at state.mn.us
Wed Nov 17 19:38:38 EST 2010
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
More information about the gdal-dev
mailing list