Select to view content in your preferred language

Slope of polyline - Python syntax error 000989

4423
10
Jump to solution
03-09-2016 07:25 AM
CamillaRootes
Deactivated User

Hi

I am trying to calculate the % slope of multiple polylines in a shapefile. I am using Arc 10.1 with the basic licence.

When I run my code in the Field Calculator I get a Python syntax error on line 3. I can't see the issue - can someone tell me where I'm going wrong?

My code is:

NB - I am not sure what directions the polylines were digitised in. Hence I don't know if the last point is at the higher elevation or vice versa, which is why I am trying to return the absolute change in z value.

The error read out I am getting when I run the code is:

Thanks in advance!

0 Kudos
10 Replies
CamillaRootes
Deactivated User

I've written up the solution to this problem, including Field Calculator Python codes for straight line length, percentage slope and degrees slope. See this document for my write-up:

Python code for straight line slope of a polyline (inc. straight line length, pecentage slope, and d...