5

I just want one line that represents the centroid of a bunch of parallel lines, which one in each bunch doesn't matter.

I've already tried doing a dissolve operation to make one thick line that overlaps the unwanted ones, but the result looks clunky and I would really rather a Polyline as data.

This is what the data looks like right now. I drew a few black lines between the clusters in the paint to show you what I am going for.

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
hmnoidk
  • 709
  • 2
  • 12
  • 1
    Maybe a look here could give some ideas: https://gis.stackexchange.com/q/383999/88814 – Babel Apr 22 '21 at 13:26

1 Answers1

6
  1. Buffer the lines with dissolve so all nearby lines are inside the buffer, but not so wide that the other line clusters are included
  2. Multipart to Singlepart
  3. Field calculate a group attribute (@row_number)
  4. Intersect with lines to transfer the group attribute to each line
  5. Extract one random line per subset/group:

enter image description here

BERA
  • 72,339
  • 13
  • 72
  • 161