3

I want the count of the number of raster pixels within that polygon. I ran the Zonal Statistics as Table tool using one polygon as the feature zone data and only getting the SUM. I thought it would be the sum but i had done some rough calculations another way and got the number in the COUNT field.

Can someone explain what the difference between Count and Sum are?

screenshot of the output table from the zonal statistics as table tool

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Dec 20, 2016 at 2:03

1 Answer 1

11

What you are looking for is COUNT, which is the frequency of the cells that you processed through Zonal Statistics. Sum, on the other hand, is the sum of cell values covered by your polygon. Overly simplistically, say, your cell values are 2,1,3,4,4 in this case COUNT is 5 and SUM is 14.

answered Dec 20, 2016 at 2:36
4
  • Thanks @fatih_dur ! How could my SUM value (above image) be smaller than the COUNT number? I do have quite a few NoData pixels, but those shouldn't be counted in the COUNT, right? Commented Dec 20, 2016 at 2:48
  • @cAnna01, do you have negative values in your raster? That could offset the sum. Commented Dec 20, 2016 at 3:24
  • @Fezter Nope, no negative values :/ Commented Dec 20, 2016 at 19:00
  • 1
    oh jeez, you guys i had a dumb moment! i just realized the reason it looked like the SUM was lower is because in the attribute table the column was made too skinny and so it chopped off the last digit. insert face palm emoticon haha. thanks for your help! I understand it all now! :) Commented Dec 20, 2016 at 20:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.