ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Raster Namespace / Raster Class / GetAttributeTable Method
Example

In This Topic
    GetAttributeTable Method (Raster)
    In This Topic
    Gets the attribute table of this raster. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetAttributeTable() As Table
    public Table GetAttributeTable()

    Return Value

    A ArcGIS.Core.Data.Table representing the attribute table of this raster or null if none exists.
    Example
    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;
          }
        });
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also