[GIS] Problem about converting raster to polyline and calculating total length

arcgis-10.0lengthlineraster

I have raster file of line segment. I need to convert it to line and get the distance of that line. How can i do using Python and ArcGIS 10? I have tried with GIS tools Convert Raster to Polyline but the line segment is not straight and it is divided into no of segments, isn't it possible to get single line segment.

enter image description here

I have attached herewith pictures. My problem is to find out the width of dam. For that I have drawn cross section at a regular interval along the stream. I have also shown how I will find out the width.. If you have any suggestion please provide me. And talking about my problem, after raster analysis of taking the difference of two raster. I have a raster segment shown in right side of picture. I tried to Convert Raster to Polyline but line is not straight and break into several segment. I need to have one line segment which is straight.

Best Answer

If you want a programmatic solution, you could use arcpy.sa.Thin and then RasterToPolyline.

I think @whuber has the easiest solution for one time tasks with the measure tool.

Found a few things on the centerline from a polygon idea (e.g., http://resources.arcgis.com/en/help/main/10.1/index.html#//010n00000019000000), but still sounds kind of involved.