I have a line shapefile showing the street network for a major city in Africa. For each line segment, I want to calculate the total number of roads/streets connected to it. For example, the road highlighted in red is a line segment with 4 roads connected to it. How do perform this for all line segments in QGIS?

enter image description here


You can get line intersections.This video shows line intersactions tool. Number of intersection points on line is the number of roads connected to that road. You can use spatial join to count points on line Count number of points per line in QGIS .

  • Thank you very much for the help, and for directing my attention to the other tutorials! – The-PhD-Gamer Apr 16 '18 at 13:04
  • Sorry to disturb you but do you know any efficient approach to classify a line segment having a dead-end in QGIS? – The-PhD-Gamer Apr 16 '18 at 13:18
  • May be there is a simpler solution but I'd try as: 1. Vector -> Geometry Tools -> Extract Nodes(get all nodes) 2. Spatial join extracted nodes with source data. 3. Nodes that are on single line are dead-end nodes. 4. Lİne segment that has same segment_id with result of 4 is a segment with dead end. – senol ozgur Apr 16 '18 at 13:52
  • Thank you for suggesting this approach, I will give this try. – The-PhD-Gamer Apr 16 '18 at 14:16

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.