[GIS] Creating line between middle of polylines which are intersected using ArcPy

arcgis-10.0arcpy

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.

Best Answer

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.)