[gdal-dev] FYI - embedding overviews into read only file

Martin Chapman chapmanm at pixia.com
Mon Jan 9 21:35:43 EST 2012


I agree with your reasoning for letting the api do it anyway because it
would be a pain to close and reopen the file.  I just wanted to let you
know in case it was a bug.  Thanks for the response.

Best regards,

-----Original Message-----
From: fwarmerdam at gmail.com [mailto:fwarmerdam at gmail.com] On Behalf Of
Frank Warmerdam
Sent: Monday, January 09, 2012 7:16 PM
To: Martin Chapman
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] FYI - embedding overviews into read only file


In general GDAL is very poor about checking read-only vs. read-write
status.  I presume the overviews where in a .ovr file, not in the original
file itself, right?

I will note it is desirable that we can build overviews for files even if
we can only open the files readonly (ie. formats that don't support
update), so I wouldn't want to introduce careful update permission
checking now.

Best regards,

On Mon, Jan 9, 2012 at 6:03 PM, Martin Chapman <chapmanm at pixia.com> wrote:
> Frank,
> It just dawned on me that yesterday I used the following code to open
> a raster file like so:
> mDataSource = (GDALDataset*) GDALOpen(filePath.c_str(), GA_ReadOnly);
> And then used the GDALDefaultOverviews class to embed some overviews
> into the file.  Shouldn’t the API prevent that if I opened the file as
read only?
>  I initialized the default overviews class using the dataset pointer. 
> I am using GDAL 1.8.1. .  I used the BuildOverviews() method of the
> default overviews class to execute the process.
> Best regards
> Martin
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

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 Software Developer

More information about the gdal-dev mailing list