Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

If - then comparing two attribute fields

$
0
0
I am try to use a Python codeblock in the field Calc tool to compare two separate fields, and populate a third.

For Example:

def Reclass(Buffers):
if (SIZE = Large and Fishbearing = Yes):
return 200
elif (SIZE = Large and Fishbearing = No):
return 150
elif (SIZE = Medium and Fishbearing = Yes):
return 125
elif (SIZE = Medium and Fishbearing = No):
return 100

SIZE and Fishbearing are the comparison fields, Buffers is my new field.

Any tips?

Thanks, Kevin

Viewing all articles
Browse latest Browse all 2485

Trending Articles