6

My goal is to find the total length of roads per county for a particular state. You would think there would be a simple government spreadsheet with this information in it....

I cannot figure out how to find the summed lengths of a polyline layer(roads) in each county (polygon) in QGIS. I have tried using Vector-> Analysis -> Sum line lengths but it just reproduces the county shapefile with a length column, of which I have no idea what unit it is in.

  • Please note that thread titles are supposed to be to the point and in question form. You already found the sum line lengths tool which would answer "how to sum lines in polygons?". The open question is how to measure line length in meters. For a suitable CRS recommendation we need to know which geographic area you are working in. – underdark Jul 18 '13 at 17:52
4

"Sum line lengths" calculates length in the units of the input layer's CRS. So if the input layer is in WGS84, the results will be in degrees. If the input layer is in some UTM projection, it will be meters or feet.

NOTE: Reprojecting on-the file does NOT change the results of length calculations. You have to reproject the layers permanently using "Save as ..." and use the newly generated files.

  • Thanks for the reply. The CRS is NAD83. How would you convert the degrees to kilometers in QGIS? I know how to do this in Excel but am wondering if QGIS can do this. – user20224 Jul 18 '13 at 17:07
  • 1
    @user20224 The idea is not to convert degrees to kilometers but the reproject the original layer into a metric CRS and then measure directly in meters. Could it be that your NAD83 projection is using feet? – underdark Jul 18 '13 at 17:17
  • Could you suggest a CRS please? And for lengths of roads, I am getting small numbers such as 3.34234 for an entire county, so it appears to be degrees. – user20224 Jul 18 '13 at 17:39
  • I am trying to perform this operation for every county in the country (USA). – user20224 Jul 19 '13 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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