[Gdal-dev] GDALScaledProgress confusion

Stefan Klug Klug.Stefan at gmx.de
Thu Jun 7 07:44:07 EDT 2007


Hi,

I'm trying to use GDALScaledProgress and GDALCreateScaledProgress and 
I'm a bit confused by its correct usage.

The docs say at http://www.gdal.org/gdal_8h.html

pScaledProgress = GDALCreateScaledProgress <http://www.gdal.org/gdal_8h.html#462c1d7aa414cdacd608d62e1830ef43>( 0.0, 0.5, pfnProgress, pProgressData );
GDALDoLongSlowOperation( ..., GDALScaledProgressFunc, pProgressData );
GDALDestroyScaledProgress <http://www.gdal.org/gdal_8h.html#f1ac4100ae77f94983d45a33fc1b6fcd>( pScaledProgress );

shouldn't pScaledProgress be passed to GDALDoLongSlowOperation() instead of pProgressData?
This is the way it is used in /frmts/gtiff/geotiff.cpp.

I even got more confused when I read /frmts/gtiff/gt_overview.cpp where in line 330... it is used like this:
pScaledProgressData =  GDALCreateScaledProgress( ...,pfnProgress, pProgressData );
GDALRegenerateOverviews( ...,pfnProgress,pProgressData);
GDALDestroyScaledProgress( pScaledProgressData );

Here the scaled progress seems to be completely left out.
To me it looks like a small bug...

Would be nice if someone could shed some light on this.

Regards Stefan









More information about the Gdal-dev mailing list