2

I would like to write a condition in ArcGIS 10.1 in Raster calculator.

I have 2 overlapping rasters (Ras1.img, Ras2.img) with different attributes in attribute table:

  • Ras1.img: Class - results of supervised maximum likelihood classification
  • Ras2.img: Att - landuse, raster converted from shapefile polygon format

I want to change pixel values Class in Ras1.img based on the values in Att, Ras2.img. something like:

if ((Ras1.img, Class == 20 & Ras2.img, Att == 5), then change Class value 20 in Ras1.img  to Class 25))

I can't figure that out. It is super simple in R, but I have no idea how to make it in ArcGIS 10.1.

I was trying to figure that out by : http://resources.arcgis.com/en/help/main/10.1/index.html#//009z000000zn000000

and applying something like:

Con(("landuse1" == 1) & ("landuse2" == 5), "landuse1" + "landuse2", 99)

but I don't understand where I specify the attributes of my rasters I would like to change?

  • Rasters usually have only thing which 'Cell value', no attributes. Indeed Raster calculator uses the Cell Value for the 2 rasters while comparing. – Shiko Dec 2 '16 at 9:51
  • when I tried just a simple expression i.e. Con(("Ras1" == 20), 0, 25) , I didn't get back a correctly reclassified output.. So I think I am making something wrong.. – maycca Dec 2 '16 at 9:53
  • Question please, the reclassified rastes you have were produced from ArcGIS supervised/unsupervised tool ? – Shiko Dec 2 '16 at 9:59
  • yes, Raster1 yes. The second is the true type of landuse, by which I want to correct my classification results – maycca Dec 2 '16 at 10:00
  • What I know that the output of supervised classified is not exactly RASTER image, even you may check the output file type. May be you need to convert this image to Raster. – Shiko Dec 2 '16 at 10:05
1

Try the Reclassify tool: http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/reclassify.htm

Open this tool and you should be able to input your raster, then redefine pixel value(s).

  • @maycca if you liked this answer please "accept" it so the question does not show as unanswered – Stella Apr 17 '18 at 16:43

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.