I would like to be able to take all values between 1 and 10 and have a field define them as 1, and all values between 10 and 20 and set them to 2, how do I do that with vector data?
I read how to set all building to 20, and grass to 40, but I'm pretty sure that to do that for a range of values, like 1-10, I would have to manually enter each number, and decimal in that range. Am I wrong? and if not, how would I accomplish this?
Answer
This is a Job for the Field Calculator.
See this Python example at Calculate Field examples
Parser:
Python
Expression:
Reclass(!WELL_YIELD!)
Code Block:
def Reclass(WellYield):
if (WellYield >= 0 and WellYield <= 10):
return 1
elif (WellYield > 10 and WellYield <= 20):
return 2
elif (WellYield > 20 and WellYield <= 30):
return 3
elif (WellYield > 30):
return 4
No comments:
Post a Comment