[gdal-dev] advice on feathering rasters together?
Jamie Adams
dickeya at gmail.com
Wed Feb 20 13:22:06 EST 2008
Hey Matt,
I recently encountered this exact same problem and would like to find a gdal
based solution. I ended up solving the problem in Grass by creating a
grayscale mask of the replacement area and used a convolution filter to
feather the edge. I used this in r.mapcalc to weight the addition of the
two rasters.
It seems this approach could be duplicated with gdal / python. The main
issue would be the creation of the mask to weight the feathering. The rest
should be pretty simple math.
Let me know if you've heard any other solutions, I'd be interested in
pursuing this more.
Thanks,
Jamie Adams
On Feb 19, 2008 5:04 PM, Matt Wilkie <matt.wilkie at gov.yk.ca> wrote:
> Hello,
>
> Does anyone have any advice on how to feather rasters together so there
> is not an abrubt transition from one to the other?
>
> The circumstance: I have 16bit integer raster (a DEM) with some areas in
> it I want to fix (lakes which should be flat). I've created a second
> raster with the desired replacement values (fixed_lakes). However if I
> blindly just substitute fixed_lakes.tif for dem.tif there are some
> pretty abrubt transitions which are sometimes worse than the original
> problem.
>
> I've done this before using Gimp and 8bit images but gimp can't load
> 16bit images without losing half the bits. (in layer pallet stack
> fixed.tif over original.tif > transparency to selection for fixed layer
> > invert selection > expand X pixels > feather > flatten image; restore
> spatial reference with gdalcopyproj.py)
>
> thanks in advance for your thoughts,
>
> --
> matt wilkie
> --------------------------------------------
> Geographic Information,
> Information Management and Technology,
> Yukon Department of Environment
> 10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
> 867-667-8133 Tel * 867-393-7003 Fax
> http://environmentyukon.gov.yk.ca/geomatics/
> --------------------------------------------
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080220/f8f54d69/attachment.html
More information about the gdal-dev
mailing list