[gdal-dev] Unable to write in subdataset

Cole, Derek dcole at integrity-apps.com
Wed Jul 20 08:32:45 EDT 2011


Doh! Thank you, I will fix that and see what happens. I suspect that solves the problem! Stared at it too long I guess!

Thanks,

Derek
________________________________
From: Chaitanya kumar CH [chaitanya.ch at gmail.com]
Sent: Tuesday, July 19, 2011 11:30 PM
To: Cole, Derek
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Unable to write in subdataset

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<mailto: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<mailto: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/8c0ce633/attachment.html


More information about the gdal-dev mailing list