2

I have slope raster and that is categorized with slope in percentage(%) my condition is

if                 
             slope <= 1     then m = 0.2    
         1 < slope <= 3     then m = 0.3     
         3 < slope <= 5     then m = 0.4    
         5 < slope          then m = 0.5  

Here "slope" is raster data and m is other variable that change as per slope percentage.

Is used raster calculator in ArcGIS 10.1 with script shown as below:

Con((("Slope" <= 1),0.2)  |  (("Slope" <= 3  &  "Slope"  > 1),0.3) | 
    (("Slope" <= 5  &  "Slope"  > 3),0.4) | (("Slope" > 5),0.5))

But it is not successful.

  • 3
    Could you say how it is not successfull? – John Powell Jan 11 '16 at 10:38
2

Here is how I would write this to reduce the number of tests :

Con("Slope" <= 1 , 0.2 , Con("Slope" <= 3 , 0.3 , Con("Slope" <= 5, 0.4 , 0.5)))

Note that you need to write several Con() because "|" is only used to test booleans.

1

Why don't you just use a reclassify?

Other option it would be to read the raster like array and then perform the changes in the sense you want.

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.