I have a raster attribute table associated with an IMAGINE .img raster that I build and open with:
IGPUtilities utils = new GPUtilities(); IRasterDatasetEdit2 raster = (IRasterDatasetEdit2) utils->OpenRasterDatasetFromString(path); raster.BuildAttributeTable(); ITable vat = (raster as IRasterBandCollection).Item(0).AttributeTable;
I need to add new column to the table and populate with values. However, calling
AddField on the table throws "The method or operation is not implemented" exception.
IFieldEdit field = new FieldClass(); field.Type_2 = esriFieldType::esriFieldTypeString; field.Name_2 = "Name"; vat.AddField(field as IField); // Throws
Is there a direct way how to modify the existing attribute table or do I have to create one on my own and assign it to the raster using
I'm using ArcObjects .NET SDK with ArcGIS 9.3.1.
Once again ArcMap behaves curiously: When I open the raster in ArcMap after my code failed to add the field, I can open the attribute table but the 'Add Field...' option is disabled. If I remove the raster and open it again, I can add fields from ArcMap and also my code works!
Everything works fine with GeoTiff images.
I do not think this is a locking issue since I'm releasing all COM instances (via