Select to view content in your preferred language

Cell statistics?

3364
10
06-18-2012 01:05 PM
DANIELEVILA_NOVA
Occasional Contributor
Hello all

I have a set of rasters and each one of them has cell values that goes from 1-4. I wanted to know if there's a way (I was thinking about using cell statistics, but maybe it's somewhere else?) for me to know exactly the amount of values for each of these categories (1-4) if I sum up all cells on the rasters.

EX:. If the total of a given cell on the output raster is, let's say, 16, is there a way for me to know how many 1s, 2s, 3s, and 4s are responsible for this total? These values makes a huge difference for my analyses, so if this imaginary total '16' is a result of 1+1+1+1+1+1+1....+1 or 4+4+4+4 or 3+3+2+2+4+1+1 or any other combination you can think of, this will directly influence my results/discussion.

Any inputs on how can I figure this out?

Thank you very much!!

Daniele
0 Kudos
10 Replies
SteveLynch
Esri Regular Contributor
[ATTACH=CONFIG]15309[/ATTACH]

3 random rasters, each with integer values between 1 and 4. The COMBINE output has a table that lists all the combinations, viz.,
There are 1001 occurrences where raster1=1, raster2=1 and raster3=3. You can add a field and sum these 3 columns into it.

There may be many other solutions, this is the first one that came to mind.

Steve
0 Kudos
DANIELEVILA_NOVA
Occasional Contributor
Hi Steve,

thanks for your suggestion. I'm gonna try with my data here and let you know how it worked.

Cheers

Daniele
0 Kudos
DANIELEVILA_NOVA
Occasional Contributor
Hi Steve,

Only now I got the chance to run the COMBINE option that you mentioned, but it didn't work cause I have (much) more than 20 rasters (there was this error while processing the analysis, it said 'the number of input raster bands exceeds the current limit (20). I am using ArcInfo level, is there a way to change this limit?

Thanks

Daniele
0 Kudos
DANIELEVILA_NOVA
Occasional Contributor
Oh, and I tried to run only with 20 rasters, but my output raster was blank, so this option didn't work? Any other suggestions??
0 Kudos
curtvprice
MVP Esteemed Contributor
Hi Steve,

Only now I got the chance to run the COMBINE option that you mentioned, but it didn't work cause I have (much) more than 20 rasters


Maybe if you explain your analysis in more detail? What is the output you are trying to create once you get this (potentially very long and wide) table?
0 Kudos
DANIELEVILA_NOVA
Occasional Contributor
Hi Steve,

The table for each raster has only objectID, the value and count... my output table for the combine function took the name of each table and added as a column, instead of taking the values and counts. Oh and for each table (each raster) have only one of the four options I mentioned on my first Threat (for values ranging from 1-4, each raster has either 1, 2, 3 or 4, not a combo of these numbers)

Thanks

Daniele
0 Kudos
curtvprice
MVP Esteemed Contributor
Daniele,

The Combine approach Steve mentions cross-tabulates; creating a new zone for for each unique input value combination. I believe you are wanting cell by cell processing instead.

If you want an individual row in your output for each input cell, a way to do this is create a point data set (using Raster To Point) at each cell centroid, and run either Extract Multi Values to Point or Sample.

You could then grid up the resulting points if you want a raster with all the attributes.

If it's a large raster it will take a while, and you could run into file size problems, but I know this would work for a small raster. If this raster is of appreciable size, I recommend doing this with the current and scratch workspace set to a file geodatabase so you won't run into a file size limit on a .dbf table.
0 Kudos
DANIELEVILA_NOVA
Occasional Contributor
Hi Curtis,

thanks for the suggestion. The thing is that my rasters have different sizes and are many (over 100, depending of the combination of rasters I need to do the analyses). Do you think it would work for me?

Thanks

Daniele
0 Kudos
curtvprice
MVP Esteemed Contributor
The thing is that my rasters have different sizes and are many (over 100, depending of the combination of rasters I need to do the analyses). Do you think it would work for me?


I don't see why not as these tools sample for each point location, and will pick a value regardless of how things "line up" against each grid. (Be sure and specify nearest neighbor interpolation to capture your categories.)

If you do run into some limits trying to extract from your many rasters, you could always extract a fewer number at a time and join the output tables.
0 Kudos