[gdal-dev] updating a HFA image

Limei Ran lran at unc.edu
Wed Apr 2 13:27:22 EDT 2008


Hi Frank:

Thank you for your help.  I worked on the image created by 
CreateCopy().  It worked.  But, when I looked at the updated file in 
arcGIS.    It appears to be not updated.

I used:
=============
poBand->RasterIO(GF_Write, 
c_col1-1,c_row1-1,c_nXSize,c_nYSize,poImage,c_nXSize,c_nYSize,GDT_Byte,0,0)
poRDataset->FlushCache();
GDALClose( (GDALDatasetH) poRDataset );
CPLFree (poImage);
=============

Do I need to write the updated band to poRDataset after I use 
poBand->RasterIO or do something else?  The images are HFA format.

Thanks,

Limei

Frank Warmerdam wrote:

> Limei Ran wrote:
>
>> Hi Frank:
>>
>> The original image file was a USGS NLCD landuse image (I think it was 
>> created in the IMAGINE package).   I used 
>> poRDataset->GetDriver()->CopyFiles made a copy.  Then, I updated the 
>> copied file.  I will file a ticket with a small area result.
>
>
> Cool, thanks
>
>> For a quick solution, could I translate the image into an EHdr format 
>> image using gdal_translate and then update it with EHdr format or 
>> other better format you may suggest for reading a region from the image?
>
>
> That should work, or I presume you could even use the Driver CreateCopy()
> method to copy the image contents, instead of literally copying all the
> component files.  This would give you a GDAL generated .img file that
> should hopefully be more safely updated.
>
> Best regards,




More information about the gdal-dev mailing list