0

I have all these line segments travelling between points:

enter image description here

I want all the one close to each other to be merged into a single feature. So I dissolved them like so:

enter image description here

Now I just want one line travelling through the centre of each of these line-like polygons. Any functions that do this?

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
hmnoidk
  • 709
  • 2
  • 12
  • possible duplicate of https://gis.stackexchange.com/questions/171145/skeletonize-vectors-in-qgis-python – Ian Turton Apr 22 '21 at 10:59
  • Thanks, but I would say not. Skeletization kind of follows the contours of the dissolved polygons. I'm looking for something that cuts right through it y = mx +b style. – hmnoidk Apr 22 '21 at 11:06
  • And https://gis.stackexchange.com/questions/33887/finding-centrelines-from-polygons-in-qgis – BERA Apr 22 '21 at 11:07
  • Find the centroid of the grouped vertices of the original line features for each polygon, split into each end, and join the centroids? – Spacedman Apr 22 '21 at 11:13
  • 1
    Some of these polygons look like very thin X or Y forms, so I guess your line will run down the middle of the arms of the X or Y, and not be inside the polygon at that point? Hence skeletonization is not the answer. – Spacedman Apr 22 '21 at 11:14
  • Yes exactly @Spacedman. Totally linear line. I don't think these solutions meant for roads and rivers are not necessarily what I want. I'll take what I can get though. – hmnoidk Apr 22 '21 at 11:47
  • 1
    to get rid of the "arms", create a convex hull polygon over each of your polygon (or group of original lines), then you you can apply skeletization – JGH Apr 22 '21 at 13:08

0 Answers0