Hello i have a slope layer and i want to reclass it in to classes with python in arcpy window. I used this code:
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "c:/suit/Sik"
# Set local variables
inRaster = "outSlope"
reclassField = "VALUE"
RclSlope = Reclassify("outSlope", "VALUE", RemapRange([[0,45,1],[45,87,2]]))
RclSlope.save("c:/suit/Sik/RclSlope")
but finally i get 3 classes[0-45 1st class, 45-87 2nd class, 87 3rd class] due to the reason that in the second class. 87 is not the maximum value of slope but 87,7 is. How can i write the code so as to take the maximum value of slope at the second class?
note: Slope is countable to degrees
Thanks a lot
Solved! Go to Solution.
Hi Kon,
You could replace the value of 87 with 88. Then the maximum value of 87.7 would be included in the second class itself.
Thanks,
Jay
Hi Kon,
You could replace the value of 87 with 88. Then the maximum value of 87.7 would be included in the second class itself.
Thanks,
Jay
Or (lazy answer), replace the value to 91 - then you're guaranteed to include the maximum value of 90 degrees regardless of the actual maximum data value.
hahaha ok, it wasn't so complicated as i thought. Thanks a lot
Just remember as well, that you can go into the symbology the layer and change the labels for the classes to represent what you want for example
real easy
No too bad
getting tired
grief!!! who picked this route
and not show the actual values at all