By Ben Thompson


2013-12-19 19:08:17 8 Comments

I have a vector polygon shapefile outlining counties for which I have a raster of nighttime-luminosity data. I've been able to compute Zonal Statistics in ArcGIS 10.0 using Zonal Statistics as Table and simply selecting the polygons as the first feature class option. However, I'd like to get some more stats than those that are available with the pre-packaged Zonal Stats. Specifically, I'd like to get counts and values -- for instance, the number of pixels with a given luminosity value in each polygon. Does anyone know if this is possible? If not in ArcGIS, in QGIS, perhaps? Thanks.

2 comments

@whuber 2013-12-19 21:19:51

For a count of "lit" pixels--or of any other kind of cell value for that matter--simply create a binary indicator grid. This is a grid with ones at the cells where the values are to be counted and zeros elsewhere: it should be clear that the zonal sum of these values counts the cells.

To create an indicator, exploit the fact that true values will be stored as ones and false values as zeros. If, for instance, a "lit" value is a positive value, simply compare the original grid to zero (using ">" in a raster calculator). There is no limit to the complexity of the logical criteria you can use in creating indicator grids; they can even be based on multiple grids. That makes this an extremely general and flexible technique for counting anything in a grid (or image) within (nonoverlapping) zones.


This question--and the answer--generalize the one at Finding zones with nodata in ArcGIS 9.3.

@radouxju 2013-12-19 20:11:15

there is another function called "zonal histogram" in ArcGIS (http://help.arcgis.com/en%20/arcgisdesktop/10.0/help/index.html#//009z000000w6000000.htm). With the table you can extract anything you want. It is however recommende to resample your nightime data before use in order to have an integer image.

Don't forget to set the pixel size equal to the resolution of your image when you use this tools because ArcGIS often uses a coarser resolution to reduce the computational cost.

@Roland 2014-01-17 17:00:25

if you need information to the right of the decimal in the image, you can multiply by some factor of 10 prior to applying int().

Related Questions

Sponsored Content

2 Answered Questions

4 Answered Questions

0 Answered Questions

Unexpected elevation values from SRTM using Zonal statistics

2 Answered Questions

[SOLVED] Getting tabular statistics from table using QGIS?

  • 2012-12-04 00:16:08
  • RyanDalton
  • 16091 View
  • 12 Score
  • 2 Answer
  • Tags:   qgis statistics

1 Answered Questions

2 Answered Questions

[SOLVED] ArcGIS Multiband Raster

1 Answered Questions

0 Answered Questions

Calculating Autocorrelation in Different Zones

1 Answered Questions

1 Answered Questions

Sponsored Content