GetAttributeTable Method (Raster)
Gets the attribute table of this raster.
This method must be called on the MCT. Use QueuedTask.Run.
public Table GetAttributeTable()
Public Function GetAttributeTable() As Table
Return Value
A
ArcGIS.Core.Data.Table representing the attribute table of this raster or null if none exists.
Access rows in a raster attribute table
var raster = MapView.Active.Map.GetLayersAsFlattenedList().OfType<RasterLayer>().FirstOrDefault();
if (raster != null)
{
await QueuedTask.Run(() =>
{
var rasterTbl = raster.GetRaster().GetAttributeTable();
var cursor = rasterTbl.Search();
while (cursor.MoveNext())
{
var row = cursor.Current;
}
});
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.