AndreasGinau

Sorting contour lines

Discussion created by AndreasGinau on Sep 24, 2012
Latest reply on Sep 24, 2012 by dkwiens
Dear Python+Arcgis experts,
I want to sort my contour lines.
My table contains the field CONTOURS (double) and sort (double). I want that contours ending with 5 get the value 5 for sort, contours ending with 10 the value 10 and all other contours should get the value 1 for sort.

I tried this code:

def Reclass(contours):
    if contours % 10 == 0:
        !sort! = 10;
    elif contours + 5 % 10 ==0:
        !sort! = 5;
    else:
        !sort! = 1;

Reclass(!Contours!)

but it doesn't word.
I hope you can help me with.
Andreas

Outcomes