[Gdal-dev] Building overviews in external .ovr file
programatticall
Tim Sutton
tim at linfiniti.com
Mon Jul 25 19:01:27 EDT 2005
Hi
Sorry my original message was not very clearly put. I have already
implemented an overview builder in QGIS (since 0.6 release). Looking at the
gdaladdo code, its not substantially different to what I have implemented.
Some users filed bugs about QGIS not producing overviews for certain file
types e.g. jpg. So I went back to the gdal docs (the gdaladdo docs instead
of the api docs I previously used) to try to see what the supported file
types were and then realised that it mentions the ability to e.g. build ovr
files. On closer investigation however, I have discovered the real problem
was that I was not handling errors correctly as I'd stubbed out bits of
error handling code based on gdal api docs that didn't work. To resolve the
problem I had a poke around in the gdal sources and discovered the following
small errors in the api docs:
GDALDataset::BuildOverviews 'CPLE_NonSupported' should read
'CPLE_NotSupported'.
The same error is also in GDALRasterBand::BuildOverviews.
Also these same docs sections state that an error can be picked up using
CPLGetLastError(), but after a bit of snooping around in the source is looks
like its actually CPLGetLastErrorNo() that should be used.
That allowed me to implement a better error handler and will hopefully
resolve my problem mostly.
Hope thats useful :-)
Regards
Tim
On Monday 25 July 2005 16:07, Frank Warmerdam wrote:
> On 7/24/05, Tim Sutton <tim at linfiniti.com> wrote:
> > Hi
> >
> > The docs mention the ability to build .ovr files, but I dont see any way
> > to force the behaviour programmatically. Are .ovr files supported on all
> > formats? Is there a list of supported overview friendly formats if not?
>
> Tim,
>
> Check out the BuildOverviews() method on the GDALDataset for
> information on how to build overviews programmatically.
>
> http://www.gdal.org/classGDALDataset.html#a24
>
> I would add that the gdaladdo source is quite short and you can
> look at it.
>
> There is no clear way to figure out what formats support overviews.
> Most do, but not all.
>
> Best regards,
--
"The mind once expanded to the dimensions of larger ideas never returns to
its original dimensions."
-------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050726/445b4293/attachment.bin
More information about the Gdal-dev
mailing list