1

I have many line objects in a layer called "line" (pink). Further, I have line objects in a layer called "Connection" (blue). The lines in "Connection" are created by the tool "distance to the nearest hub (line to hub)".

Now I want to select all object in "lines" that connect with the lines from "connection". I tried to use "Select by location" with the options "intersect" and "touch".

enter image description here

As a result, only about half of the lines are actually selected.

enter image description here

Does anyone have an idea what the problem might be?

4
  • Just for clarification, in your second image, which line features are the selected ones? Is it just the light green-ish segment on the bottom left? I've tried recreating a similar output but didn't have any issues. Maybe you have to check if your line layer geometry is valid using the Check geometry tool?
    – she_weeds
    Commented Jan 21 at 2:43
  • 3
    Without having your data, we can just speculate: please share a sample of your data. Probably the lines form the two layers are not properly connected, see e.g. gis.stackexchange.com/a/379655/88814 Try creating a (very small) buffer around your connections layer and repeat the select operation based on this.
    – Babel
    Commented Jan 21 at 10:15
  • 1
    Hello @babel. After checking your link I tried to extend my line a little bit by using the tool "extend lines". This works perfectly! Thanks for sharing the link! Apperently, in my case, "distance to the nearest hub (line to hub)" didn't create lines that really touched the target line for about half the cases. I don't know if that is a bug or maybe I did something wrong but anyways "extend lines" is a perfectly good workaround for problems like those.
    – Dennis
    Commented Jan 21 at 19:55
  • 1
    Feel free to add this as an answer and accept it. Like this, it is easier to find than hidden here in the comments.
    – Babel
    Commented Jan 21 at 20:18

1 Answer 1

0

Answer from Babel that solved my problem:

"Without having your data, we can just speculate: please share a sample of your data. Probably the lines form the two layers are not properly connected, see e.g. gis.stackexchange.com/a/379655/88814 Try creating a (very small) buffer around your connections layer and repeat the select operation based on this."

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.