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

1

1 Answer 1

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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