1

I'm still very new to python and need some direction in developing a ArcPy\Python script to determine the Equal-Area Slope of the Longest Water Course within a catchment. The Longest Water Course is a 3D polyline that represents the the longest river centre line in a catchment. The two jpegs explain the formula that I've trying to regenerate using ArcPy and Python:

Equal-Area 01

Equal-Area 02

I've figured out that I need to append the X-coordinate; Y-coordinate; and Z-value from the geometry into a python list. The I then need to step through the python list to determine the following: Area = [(0 + 1)] X 500 + ....

The 0 is the difference in height based on the first vertex Z value, which allways will be 0, the 1 is the difference in height of the second vertex Z value from the first vertex Z value, in this case 1m, the 500 is the distance between the first and second vertex.

I need assistance\guidance in how to step through the python list and calculate the following and then stick the results back into a python list or dictionary. I can then step through the python list or dictionary to determine the equal-area = [(0 + 1)/2]x 500 + [(1 + 2)/2]x 300 ....

7
  • This seems to be more of a programming question than an ArcMap/arcpy one. If you aren't having issues with arcpy (accessing data, syntax, writing data, etc.) then this is probably better suited for StackOverflow.
    – Paul
    Commented Apr 27, 2014 at 16:21
  • @Paul. That maybe so, but it's such an interesting geographic problem (at least it's new to me), it'd be a shame for it not to stay here.
    – Martin F
    Commented Apr 27, 2014 at 18:33
  • Hi Paul and Martin. I'm trying to develop a ArcPy\Python script that will extract the necessary values from a 3D Polyline that represents the river centreline to determine the Equal-Area Slope. The default slope calculation is 10/85 slope which is a lot easier to determine, but I need to determine the slope using both formulas. Commented Apr 28, 2014 at 6:03
  • Hi @Paul and Martin. I'm trying to develop a ArcPy\Python script that will extract the necessary values from a 3D Polyline that represents the river centreline to determine the Equal-Area Slope. The default slope calculation is 10/85 slope which is a lot easier to determine, but I need to determine the slope using both formulas. Commented Apr 28, 2014 at 6:06
  • I've figured out the following so far. I need to use ArcPy Data Access Module and through a Search Cursor I need to access each row and explode_to_points to access the individual points of each line, then I can access the Z values for each vertex in the line and determine the height difference. The second part is what I'm still trying to get my head around is how to get the distance along each polyline by using the MeasureOnLine Method and using each vertex point as the input point to measure the distance up to that point and between each vertex. I'll post my code as soon as I've cleaned it. Commented Apr 28, 2014 at 6:15

1 Answer 1

2

Basically, part of what you're trying to do is integration. From that angle, I found this:

Link to Stack Overflow question

It might help make your task easier, although I would expect you have to reduce all values with the initial one to make it work.

1
  • thanks so muh for the suggestion using scipy trapezoidal help solve my problem for calculating the area under the graph, the rest was simple enough to figure out, I'll post my code that others can use as reference for similar problems. Commented May 6, 2014 at 12:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.