3

I have got a river network as a feature class in a gdb.

I need to calculate the topologic attributes via the connectivity graph of the river network. A graph-theoretic representation of river networks uses rivers as vertices and river junctions as links of a connectivity graph to understand the topology of river networks (takes rivers as nodes and river intersections as links of a connectivity graph). It will give information about centrality of lines and also simplify the network.

In order to do this, I want to draw lines from the middle of each river branch to the middle of intersected higher order river. By this way, I can calculate the topological centrality of a river branch by using from-to node.

When doing this manually, I draw a polyline from the middle of a river line to the middle of intersected higher order river line. Please help me to do this automatically by using Python in ArcGIS 10. If I do it manually it will take too long because of the drainage density.

5
  • 2
    You'll have to elaborate a bit more - I don't really understand. You want to draw lines between the middle of each river branch which is interesected with what? Are you saying you want to simplify the network?
    – Stev_k
    Commented Feb 22, 2012 at 11:56
  • 2
    Inserting a sample graphic representation of what you are after would help explain your needs, and help others come up with good suggestions greatly. Commented Feb 22, 2012 at 15:32
  • This is pretty straightforward, except that I do not understand what you mean by "the middle of a river line" and "the middle of intersected higher order river line". Defining these two end points will be the most difficult part. Creating the polyline once you have these coordinates is easy. Commented Feb 22, 2012 at 16:03
  • I could not add a figure because I am a new user. I do not know how to add in other way. I want to show lines as nodes (junctions) and intersections as edges (links) in the network. For this you can use middle point of line representing a line as point (node) but it is not necessary.
    – syd
    Commented Feb 22, 2012 at 17:02
  • @syd, if you post a link to a graphic you store online, someone will gladly add it into the question for you. Commented Feb 23, 2012 at 0:14

3 Answers 3

1

Here are steps to create centerlines from polygons. Mr. Huber posted this in 2002 on the old ESRI forum. You may need to first densify the river verticies.

  1. Convert the polygons to their vertices. Retain the polygon ids.

  2. Compute the Thiessen polygon tessellation for the vertices.

  3. Convert the Thiessen polygons to a collection of line segments forming their edges.

  4. Retain only those segments that lie entirely within some original polygon. Associate the containing polygon's id with each segment.

  5. Spatially merge those segments based on polygon id.

  6. (Optional) Spline the merged segments.

Incidentally, what is being approximated here is the "medial axis transform" of each polygon, sometimes known informally as its "skeleton." Search http://www.google.com for more information. (I haven't found any practicable algorithms for the MAT on the Web, though.)

1

Have you looked at RivEX this can generate all sorts of analysis and store topological information as tables.

0

From ESRI forum, answer your created thread copied below

import arcpy
from arcpy import env
env.workspace = r"C:\TEMP\Python\test.gdb"
env.overwriteOutput = 1

fc1 = "River"
fc2 = "New_Poyline"

coordList = []

arcpy.FeatureVerticesToPoints_management(fc1, "vertices", "MID")
arcpy.AddXY_management("vertices")
rows = arcpy.SearchCursor("vertices")
for row in rows:
    X = row.getValue("POINT_X")
    Y = row.getValue("POINT_Y")
    coordList.append([X, Y])

del row, rows

coordList.sort()

point = arcpy.Point()
array = arcpy.Array()

for feature in coordList:
    point.X = feature[0]
    point.Y = feature[1]
    array.add(point)

polyline = arcpy.Polyline(array)

array.removeAll()
arcpy.Delete_management("vertices")
arcpy.CopyFeatures_management(polyline, fc2)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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