[gdal-dev] GDAL PCIDSK Driver Issue

Dennis Gocke dengo at gmx.net
Wed Feb 12 07:55:30 PST 2014


Hi,



I've encountered some problems with the PCIDSK raster driver.



Even if the raster is opened with update=0 the driver wants to write
statistics and overviews to the pix file, which produces an error "File not
open for update in WriteToFile".

You can reproduce this with the files from
pix_test.zip -
https://drive.google.com/file/d/0B_pKTK9WcAW4bEM3dG5BazlGbjA/edit?usp=sharing

Open it with update=0, calculate statistics and close it. The error
is produced when closing the dataset.
In the driver description it says "Internal overview (pyramid) images will
also be correctly read though newly requested overviews will be built
externally as an .ovr file.". This seems not to be the case, overviews are
always written to the pix file. Wouldn't it be better if the statistics and
overviews were stored in separate files when the file was opened with
update=0?


Also it seems like the driver can't read the statistics when they are
created with PCI, see attached file test_with_stats.pix. If you request the
stats they are recalculated and rewritten to file. If not opened with
update=1 see problem above.

Quick side note:
When using the C# wrapper (pseudo code):
Gdal.Open(pixFile, update=0)
band.GetStatistics()
dataset.Dispose() -> although here the problem with "File not open for
update in WriteToFile" happens
anyOtherGDALCall() -> the Exception is thrown here

This had me confused at first. Perhaps it would be good to add a
"GdalPINVOKE.SWIGPendingException.Retrieve();" to the Dataset.Dispose()
method, although it probably isn't nice design to throw an exception in the
Dispose() method.

This was tested with the current development version and the 1.10.0 final
Version.

Kind regards,
Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140212/c0179cca/attachment.html>


More information about the gdal-dev mailing list