2

I have 45 tif tiles each of 20-50MB and a single shp file with about 4000 polygons. I want to run zonal histogram in Arcmap 10 to get the number of pixels with each value for each polygon. If I convert a single polygon from the shp to a raster and use it as the zone input, I can get an output that is correct. However, for the whole shp file either as polygons or as rasters, the tool runs and reports that it completes (very fast, a few seconds), but produces no table.

I think it's because there are too many zones, maybe?

My plan had been to run a batch of zonal histograms, one for each of the 45 tifs.

Am I right that I have too many zones?

And what options for workarounds do I have?

  • What are you planning to do with 4000*45 datasets? Are you trying to get 45 histograms for each polygon? – FelixIP Dec 6 '15 at 19:05
  • Each of the 4000 polygons only overlaps 1-4 (and usually 1) of the tiles. So, I want ~4000 histograms (and really the tables that come with them). I want the distribution of pixel values within each polygon. – ecologist1234 Dec 6 '15 at 19:46
  • sounds like a job for a python script. do you use arcpy or regular python + gdal and numpy? and, is processing time an issue? – user1269942 Dec 7 '15 at 3:35
  • alas, I am not yet a pythoner. some day soon. thanks, though. – ecologist1234 Dec 7 '15 at 23:03
  • As per the Tour there should be only one question asked per question. – PolyGeo Feb 19 '17 at 5:28
4

If your tif files store integer values you might try tabulate area tool (zones-polygon ids), thus transposing the table.

It'll have 4000 rows instead of 4000 columns. If value grids store floating points, convert to integer first, this will still give you good estimate of histogram. All above is worth doing providing you value raster has less than few hundred unique values, i.e. manageable No of fields.

Make cell size into account during conversion from areas to cell count

-1

I have a vector with 23k polygons, and a raster with 8 class. Result: how many classes I have in each polygon?

https://gis.stackexchange.com/a/306266/133755

  • unclear if you mean to ask a new question, or if this is an answer to my old question, or what. – ecologist1234 Dec 18 '18 at 15:21
  • This code is my answer for you question. This is a alternative solution without Arcgis, just using python script – Cícero Alves Dec 18 '18 at 16:00
  • With python, does not exist restriction to number of polygons. Just input shapefile, raster file and whats stats do you need, then, he do. – Cícero Alves Dec 18 '18 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.