ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.CIM Namespace / StatsHistogram Class
Members Example

In This Topic
    StatsHistogram Class
    In This Topic
    Represents a raster statistics and histogram class.
    Object Model
    StatsHistogram ClassStatsHistogram Class
    Syntax
    Example
    Calculate Raster statistics
    //If a raster dataset has statistics, you can create a raster layer and get these statistics by accessing the colorizer.
    await QueuedTask.Run(() =>
    {
      //Accessing the raster layer
      var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BasicRasterLayer>().FirstOrDefault();
      //Getting the colorizer
      var colorizer = lyr.GetColorizer() as CIMRasterStretchColorizer;
      //Accessing the statistics
      var stats = colorizer.StretchStats;
      var max = stats.max;
      var min = stats.min;
    });
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.StatsHistogram

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also