6

I am working with 2 datasets:

  • delineations of the neighbourhoods
  • traffic network.

This is how they look:

enter image description here

I would like to calculate the length of the roads per neighbourhood (polygon). As you may expect some of the roads are in more than one neighbourhood so what I have to do first is "cutting" them at point where they are crossing with polygon boundaries. I have tried to use intersect tool but it did not work. I always got empty file as an output. The projection I am using is RD New (for both files) so it should work. Any ideas how can I achieve my goal?

When I have roads cut I would calculate the length of every line and afterwards sum these lengths up per neighbourhood. Is it a good way to do it?

10

Give the Sum Line Lengths tool a try, from the Vector > Analysis Tools menu:

enter image description here

This will create a new shapefile that summarizes each input polygon vector layer feature by the length of input line vector layer.

The output shapefile should have an attribute field called LENGTH as you can see in the above screenshot, but you can change that to SUM_LENGTH or something similar.

Then you can visualize your map on that field, if that is your purpose:

enter image description here

NOTE the units are important to your inputs, so in my example decimal degrees are not too meaningful...but if your input coordinate system is in metres you should be good.

  • I have tried it before (I forgot to mention that) and all obtained lengths were 0.00000. I have tried it once more and I have got the same results. Maybe I should consider that the problem lies in data, not in tools used... Anyway, thanks for your suggestion! – B Sienkiewicz Oct 13 '15 at 13:59
  • I tried to use another polygon file and it worked! So the neighbourhood dataset caused all my troubles. I should think about it earlier! – B Sienkiewicz Oct 13 '15 at 14:06

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.