[gdal-dev] update to overview resampling methods?

Even Rouault even.rouault at mines-paris.org
Fri Oct 5 14:18:51 PDT 2012


Le vendredi 05 octobre 2012 22:55:34, Frank Warmerdam a écrit :
> On Fri, Oct 5, 2012 at 12:56 PM, Even Rouault
> 
> <even.rouault at mines-paris.org>wrote:
> > > >> 3) why is AVERAGE_MP considered unfit for use in the gdaladdo docs?
> > > >> and why is it still available?
> > > > 
> > > > Historical remain ? Could likely be undocumented.
> > > 
> > > ok I will remove it, should it be removed/commented from the code also?
> > 
> > Undocumenting seems appropriate. As far as removing the implementation,
> > you might want to check with the original committer (FrankW)
> 
> Etienne,
> 
> Are AVERAGE_MP and AVERAGE_MAGPHASE really different things?  That seems
> odd.

Good question : svn blame points to activity dating back to 11 years ago ;-)

AVERAGE_MP was added in http://trac.osgeo.org/gdal/changeset/1989
AVERAGE_MAGPHASE was added in http://trac.osgeo.org/gdal/changeset/2327

My undertanding of the code is that AVERAGE_MP, at the end of a regular 
AVERAGE, calls GDALOverviewMagnitudeCorrection() which does

/*      Correct the mean and standard deviation of the overviews of     */
/*      the given band to match the base layer approximately.           */

and can apparently deal with regular or complex data types. 
GDALOverviewMagnitudeCorrection() compute statistics globally on the source 
band and on the overview band

Whereas AVERAGE_MAGPHASE only works for complex data types, and does the 
correction only on the source window used to compute each target overview 
pixel.

> 
> I don't know why it reports them as not ready for production use. 

That mention (specific to average_mp, but not to average_magphase) is in the 
initial documentation of gdaladdo : http://trac.osgeo.org/gdal/changeset/7276

Perhaps AVERAGE_MAGPHASE was assumed to be better than the original AVERAGE_MP 
?

> I would
> not want them removed, but I don't mind them not being documented.
> 
> I peeked at the qgis bug report about magphase but I see the test data is
> no longer available.  If there are problems with magphase support that can
> be demonstrated and filed as a bug I'd be interested in resolving them.
> 
> Best regards,


More information about the gdal-dev mailing list