I am using the following script in ArcGIS 10.3 to calculate Quadrant (in the format angle/NE/SE/SW/NW) from azimuth.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
def quadrant(NorthAzimuth):
if ((NorthAzimuth>=0) & (NorthAzimuth<90)):
quad = 'N '+str(NorthAzimuth)+' E'
elif ((NorthAzimuth>=90) & (NorthAzimuth<180)):
quad = 'S '+str(180-NorthAzimuth)+' E'
elif ((NorthAzimuth>=180) & (NorthAzimuth<270)):
quad = 'S '+str(NorthAzimuth-180)+' W'
else:
quad = 'N '+str(360-NorthAzimuth)+' W'
return quad
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The box Show Codeblock is cheked. This script is copied in the box Pre-logic Script Code. In the box below - "Quadrant = " is typed quadrant (!NorthAzimuth!).
My polyline shape file contains the followings fields: Start_X (double), Start_Y (double), End_X (double), End_Y (Double), Compriment (double) - polyline lenght, and NorthAzimu (double) - azimuth in degrees.
I already replace the term NorthAzimuth of script with NorthAzimu, but without sucess.
The script always returns an error message.
Please, where is the error?