Using QGIS, is it possible to split all the linestrings in a file only if another linestring's endpoint intersected the linestring but not if they completely cross each other?

For example, the image below shows when the line segments would be split.

enter image description here

While this image shows when they would not be split.

enter image description here

  • 2
    Dear @user8675309, be aware that if you use python-tag, means at one moment you have to provide a snippet of your code that you currently possess, otherwise your question may be closed as not explicit enough. Maybe try firstly focus on a solution without codding.
    – Taras
    Commented May 31, 2021 at 7:53
  • @Taras: Great that for expression-questions you don't have to provide code-snippets... ;-)
    – Babel
    Commented May 31, 2021 at 8:34

1 Answer 1

  1. Create the end-points and the lines and create a small line that passed through this point - the small red lines in the screenshot below. Use this expression with Geomtry by expression (you might change the length of the line - 10000 in my case):

    extend (
        make_line (
            end_point ($geometry), 
            project (
                end_point ($geometry),
                radians (
                        $geometry, -1
  2. Use Split with lines

Screenshot: original lines in black, behind it the blue line is the result with the yellow highlighted part selected. End-points (red) and lines used to split (red) were created with geometry generator for visualization with the expression from above:

enter image description here

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.