1

I'm facing the issue when I use the snapping tool at line layer in qgis. I turned on "snapping to segments" and then i've drawn that green lines (picture below) which touches other (purple) lines. After this i've used Vector->Analysis Tools->Line intersections and some of expected points of intersection wasn't detected. Dots are the points of intersection. I was drawing from bottom to top and vice versa. Is this a qgis problem or any snapping tool issue? Qgis 3.16.0, win 10

enter image description here

2
  • It isn't clear how your red line actually looks. Please adjust the symbologies and upload a new screenshot. – Erik Nov 19 '20 at 12:20
  • do you mean they should be green or sth? – Daniel Sobolewski Nov 19 '20 at 12:22
2

I can confirm your finding. It seems that even when activated snapping, points do not always snap. When they do and when not seems unpredictable to me. In the screenshot I draw the pink lines first, than the green ones. For the 6 lines on the left side, I started at the bottom, for the 6 lines on the right, I draw them top-down. So from this sample, one could guess that end-point snapping on the pink line is more problematic than starting point, however, there are exceptions.

So it really seems that the lines do not intersect, even though zooming in as much as possible shows the end-point of the green lines always perfectly on the pink ones.

A workaround: create a new layer for the green lines where their ends are a little bit extended to be sure that they cross the pink line. To do this, use the function extend lines from the processing toolbox and set a small distance. If you now use again Line intersections with the extended layer, all intersections show as expected. So this shows that snapping does not guarantee intersection.

enter image description here

Edit: you can use geometry generator to create the same effect, so you don't have to create a new layer. I added a symbol layer on the green layer and defined it by geometry generator:

intersection( 
   extend(
      $geometry,0.1,0.1),
      geometry(
         (get_feature_by_id(
            'pink_layer'
            ,1
          )
       )
     )
)
1
  • is there a chance that qgis devs will fix it in next deployment? – Daniel Sobolewski Nov 19 '20 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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