[gdal-dev] Unable to write in subdataset

Chaitanya kumar CH chaitanya.ch at gmail.com
Tue Jul 19 23:30:28 EDT 2011


Derek,

Why are you trying to write to the dataset after opening it as GA_ReadOnly?

On Wed, Jul 20, 2011 at 4:25 AM, Cole, Derek <dcole at integrity-apps.com>wrote:

>  Hello,
>
> I have created an image with multiple subdatasets so that I may store two
> images in my NITF. the way I am getting the data set of the second image  is
> like so:
>
> char **papszSubdatasets = GDALGetMetadata(sharpenedDS,"SUBDATASETS");
>          eraserDS = (GDALDataset *)
> GDALOpenShared(CSLFetchNameValue(papszSubdatasets, "SUBDATASET_2_NAME") ,
> GA_ReadOnly );
>          eraserBand = eraserDS->GetRasterBand(1);
>
> (this is after checking to make sure that the first DS has more than one
> subdataset)
>
> According to CPL_DEBUG, the GDALOpenShared works correctly and opens the
> file as NITF.
>
> However, at some points in my code, I am getting this thrown to console
> presumably where I am using the band's RasterIO method to GF_Write.
>
> ERROR 3: Unable to write 2097152 byte block from 8302649793.
> ERROR 1: An error occured while writing a dirty block
>
> What do these error messages mean? I mam getting a ton of them. the block
> is the same number of bytes, but the "from" changes in each instance of the
> error.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110720/b6f28c8b/attachment.html


More information about the gdal-dev mailing list