Select to view content in your preferred language

How to sum the values of all cells in particular raster?

7172
12
05-29-2012 11:28 AM
by Anonymous User
Not applicable
Original User: Jamal432@gmail.com

How to sum the values of all cells in particular raster?

The cells of the raster shown in the screenshot below represents the volume of the rainfall, how to sum the values of all these cells?

Which command can sum up the values of all cells?

[ATTACH=CONFIG]14721[/ATTACH]


Thank you for the help,
Best
Jamal
0 Kudos
12 Replies
by Anonymous User
Not applicable
Original User: Jamal432@gmail.com

Jamal,

What is the real requirement?  Do you need the count of all pixels, or just the ones with data?  These numbers can be very different as you have seen.  Why do you need the counts?  Please elaborate in detail.

Thanks,
Eric


thank you Eric for paying attention to my posts

For example, if I need to calculate the total surface area the raster covers then we need in this case to multiply rows*columns*area of the cell.

Or is this something that should be done for the cells that have none �??nodata�?� values?
0 Kudos
EricRice
Esri Regular Contributor
I doubt you would be interested in the area of NoData, so for the most part I would avoid calculating it.  I also want to point out that rows*columns*area of the cell, does not return 'surface area' in the way we use that term.  That formula is giving you the 2d area of the extent.  Surface area can be calculated in ArcGIS though using Add Surface Information or Surface Volume tools.  Zonal Geometry can be used to get 2d area of each zone in a dataset.  It sounds like you want the area of the 'real' pixels though, so you can multiply any raster by 0 and Int it, like I showed you and then put it into this tool.  Because it is a constant of 0, it would be considered 1 zone.  Technically, you could just convert the raster of 0 to polygon and get area that way.  I don't anticipate enhancing the Get Raster Properties tool in a way that would distinguish NoData pixels from valid pixels in terms of returning a count.  There are other methods for that.  We can consider returning total pixels based on col/row counts.
0 Kudos
by Anonymous User
Not applicable
Original User: Jamal432@gmail.com

I doubt you would be interested in the area of NoData, so for the most part I would avoid calculating it.  I also want to point out that rows*columns*area of the cell, does not return 'surface area' in the way we use that term.  That formula is giving you the 2d area of the extent.  Surface area can be calculated in ArcGIS though using Add Surface Information or Surface Volume tools.  Zonal Geometry can be used to get 2d area of each zone in a dataset.  It sounds like you want the area of the 'real' pixels though, so you can multiply any raster by 0 and Int it, like I showed you and then put it into this tool.  Because it is a constant of 0, it would be considered 1 zone.  Technically, you could just convert the raster of 0 to polygon and get area that way.  I don't anticipate enhancing the Get Raster Properties tool in a way that would distinguish NoData pixels from valid pixels in terms of returning a count.  There are other methods for that.  We can consider returning total pixels based on col/row counts.


Suppose that the attached raster (named LandCost) represents the land  with cell size of 10x10 meter and its value represent the cost of it in dollar. What I need know, for example, is to calculate the total cost of all the cells in the raster in dollar? what might be the best approach to do that?

For me, and based on the help you have offered:

1. I multiply the Landcost with the 10x10 to clacualte the cost of each cell size in dollar;
2. I get the INT(landcost*0)
3. I use the zonal statistical to calculate the sum of the values of all the cells!

[ATTACH=CONFIG]14838[/ATTACH]

Is this the best approach that I can follow to compute the cost of all the cells in the raster in dollar?

Best

Jamal
0 Kudos