Select to view content in your preferred language

Add sum method to Raster Object

562
2
03-28-2023 10:22 AM
Status: Implemented
DavidAnderson_1701
Occasional Contributor

The Raster Object has several summary statistics available including maximum, minimum and mean.  There is no statistic for the sum of the value for the Raster variables.  Please consider adding sum as  a Raster object method and as a value in the new as of 3.1 computeStatistics method.

2 Comments
ShaunWalbridge
Status changed to: In Product Plan
 
HannesZiegler
Status changed to: Implemented

This Idea has been implemented in ArcGIS Pro 3.2, usage:

in_raster = r"C:\path\to\data.tif"
rast = arcpy.Raster(in_raster)
stat = rast.computeStatistics()
print(stat)
print(rast.sum)

Please see the What's New documentation for more new features in Pro 3.2. Additionally, we have posted a Your Ideas in ArcGIS Pro 3.2 blog and video, take a look if interested!