AnsweredAssumed Answered

Reclassify by class

Question asked by drc_ on Feb 4, 2013
Latest reply on Jun 21, 2013 by curtvprice

I'm writing a python script in ArcGIS 10.1 in which I want to reclassify a raster as follows:

First, classify into three classes using the standard deviation method. Second, reclassify the raster's values as like this:

1st class = 1
2nd class = 2
3rd class = 3

There are two problems here, or at least I think there are two problems. The first is that there doesn't appear to be a way in ArcPy to specify the number of classes or the classification method. I tried saving a reference .lyr where a 3 class standard deviation symbology is set and then using arcpy.mapping.UpdateLayer but this takes the exact class values and applies them rather than taking just the classification method and number of classes.

The second problem is how to reclassify the cells in each class to values of 1,2,3 respectively. I don't care what the values of the cells in those classes are and in fact I don't know what they are. Because this script will be used many different times with many different input rasters I can't have a hard coded Remap table; the input raster values will be different each time. The Remap object as described here will reclassify by value or range; this is not what I want to do. I want to say, "take the first class and set those cells = 1; take the second class and set those cells = 2; take the third class and set those cells = 3". I will then convert the result to polygon so that I can use Select by Location on another dataset: "select features where value = 1; select features from another dataset which are contained by the first selection, and do some stuff to them".

I'd really appreciate any ideas you have that could help in either applying a new 3 class standard deviation classification to a raster or in reclassifying a classified raster as described above.