Is there a solution in ArcGIS 10x? Thanks. I used GME (newer Hawth's Tools) and was able to count the number of pixels of any raster class within a vector polygon. I am trying to map crops within a field, so sometimes there can be different classes (crops) within a field polygon. GME spits out class counts as different columns. So if I have 3 raster classes, three count columns. I am looking for a solution to compare the counts of these 3 columns and identify the highest count and attribute that to a new column. I.e. I want to identify the dominant crop within the field. I can look at the column count numbers and identify the dominant class, but this isn't very efficient when you have 100's of fields. Sothing similar is what I am looking for: http://www.get-digital-help.com/2009/07/17/extract-largest-values-from-two-columns-using-array-formula-in-excel/
This still doesn't work and Python gives error. I edited the V#V1 as Canola, V#V2 as Barley, V#V3 as Wheat by adding three new text fields, ![enter image description here][1]and then ran:
GetMaxFieldName({"Canola": !Canola!,"Barley": !Barley!,"Wheat": !Wheat!})
A friend helped me solve it in Excel. 1) Run MAX formula in a new column ("Max"; column O) on the four classes (rows K1:N1) to identify the highest count. 2) Add new column ("Crop", column P) after Max and run: =INDEX($K$1:$N$1,1,MATCH(O2,K2:N2,0))
See image links: http://postimage.org/image/68ham84uv/ http://postimage.org/image/r1sz7e21l/
Let me know if you solve this with Python.