[gdal-dev] Filling in holes when warping

Andrew Brooks arb at sat.dundee.ac.uk
Thu Jul 24 08:33:42 EDT 2008


On Tue, 22 Jul 2008 17:18:18 +0100, Frank Warmerdam <warmerdam at pobox.com> wrote:
> I imagine this is a limitation of the "hole filling" code:
>
> http://trac.osgeo.org/gdal/browser/trunk/gdal/alg/gdalgeoloc.cpp#L267
>
> You might want to try changing this code to go more than 3 iterations and
> see if it helps.

The loop serves no purpose at the moment (other than wasting some time!)
because iterations after the first simply do the same thing again.  I think
you want to mark a newly-filled pixel as valid, for example something like
	pabyValidFlag[iBMX+iBMY*nBMXSize] = 1 ??

Obviously I don't understand the code because I found that increasing the
size of the backmap (currently 1.3 times bigger than something else) made
the holes worse.  Using a factor of 0.5 actually gave me an image without
any holes at all!  Maybe the output image wasn't actually correct but at
first glance it seemed fine :-)

Andrew


More information about the gdal-dev mailing list