Trying to sum values within a fishnet for multiple layers

1012
4
Jump to solution
08-06-2021 03:46 PM
AmandaGrunwald
New Contributor

Hello,

I am trying to sum the values of 6 feature layers. I have created an index value for each layer within a fishnet (which is the same fishnet for each layer). I am trying to sum the values in each square of the fishnet of the 6 layers. Since I'm just learning, I was hoping their is a somewhat straightforward way to do this.

Thank you!

I attached a screen shot of the fishnet. Each square has a value of 1-6 for each of the layers.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Your last approach (spatial joins) is a good one (as indicated earlier) with the summary field added.

This is a classic case where working with raster data would be easier.  Each fishnet polygon could represent one raster cell.  Your maps as raster could simply be added together, which is a local statistic operation

Cell Statistics (Spatial Analyst)—ArcGIS Pro | Documentation

Alternative which don't require extra extensions would entail exporting the data to numpy arrays (fishnet centroid, more specifically the OBJECTID field and the attribute field) and summing the arrays since your object id's are all the same.  Local statistical functions can be done in numpy and scipy if you don't have the Spatial Analyst extension


... sort of retired...

View solution in original post

0 Kudos
4 Replies
gpnobbir
New Contributor

Could you please elaborate with little more explanation? You are "trying to sum the values in each square" - what values from the features of each layer you are trying to summarize? I see a polyline in the screenshot - actually there 6 lines (one for each layer). Say, I'm trying to get the value for the first layer on a particular square - what value?

0 Kudos
AmandaGrunwald
New Contributor

Sure, for each layer I used Summarize Within (fishnet) and then I added a field to the attribute table designate an index value; the value of each square is an integer from 1 - 6 in that field. I was actually able to get a sum by doing a Spatial Join between each layer independently (so I did 7 spatial joins) and then created a new field and summed them. I am still wondering if there is an easier way to sum all the values in one step.  

0 Kudos
DanPatterson
MVP Esteemed Contributor

Your last approach (spatial joins) is a good one (as indicated earlier) with the summary field added.

This is a classic case where working with raster data would be easier.  Each fishnet polygon could represent one raster cell.  Your maps as raster could simply be added together, which is a local statistic operation

Cell Statistics (Spatial Analyst)—ArcGIS Pro | Documentation

Alternative which don't require extra extensions would entail exporting the data to numpy arrays (fishnet centroid, more specifically the OBJECTID field and the attribute field) and summing the arrays since your object id's are all the same.  Local statistical functions can be done in numpy and scipy if you don't have the Spatial Analyst extension


... sort of retired...
0 Kudos
AmandaGrunwald
New Contributor

Thank you very much for the response! Next time I think I'll transform the layers back to rasters.

 

Cheers!

Amanda

0 Kudos