Gdal Bug? was: Re: [gdal-dev] JP2MRSID Issues

Frank Warmerdam warmerdam at pobox.com
Tue Nov 18 19:10:36 EST 2008


Michael P. Gerlek wrote:
>> int sceneWidth  = (int)(nXSize * maxWidth / (double)maxWidthAtL0 + 0.99); 
>> int sceneHeight = (int)(nYSize * maxHeight / (double)maxHeightAtL0 +
>> 0.99);
> 
> Ouch, you shouldn't be doing rounding like that.  Use the getDimsAtMag()
> function to get the exact width/height you need and all will be well.

Michael,

I have reviewed the documentation for LTIImage:getDimsAtMag() and it appears
to just return the size of the whole image at a particular magnification level.
The above calculations are intended to find the size of the RasterIO() request
window at the desired zoom level.  So I don't think it is applicable.

I have filed a ticket on the problem I found (which happens to have also been
responsible for a bug reported by a client this week) and I have committed
a fix in 1.5 and trunk.

   http://trac.osgeo.org/gdal/ticket/2689

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list