[gdal-dev] updating a HFA image
Limei Ran
lran at unc.edu
Wed Apr 2 14:31:07 EDT 2008
Hi Ivan:
I got rid of .aux and it worked right.
Thanks for all your help.
Limei
Lucena, Ivan wrote:
> Limei,
>
> When you do anything to a image file outside ArcGIS and you keep using
> the same file name, remember to delete the .aux files.
>
> Ivan
>
>
> Limei Ran wrote:
>
>> 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,
>>
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>>
More information about the gdal-dev
mailing list