Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Could you post a screenshot so we have a better understanding of the problem? – Aaron May 26 '13 at 14:48
I have attached picture for the better understanding of my problem. Please provide me some guidance in this matter. – Ja Geo May 26 '13 at 15:43
How is the image to the right flawed? To me it appears as if Raster to Line worked properly. Could you also please define " is divided into no of segments..."? Thanks for the clarifications – Aaron May 26 '13 at 16:00
When I convert raster into Polyline. It is converted into several segments with short distances. Is it possible to make only one segment so that I can get width directly ? – Ja Geo May 26 '13 at 16:10
Why not just apply the ruler tool to read off the length(s)? If you need an automated solution, it's often more reliable to convert the shape to a polygon, compute its centerline, and obtain that length. – whuber Jun 12 '13 at 15:56

If you want a programmatic solution, you could use 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.,, but still sounds kind of involved.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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