Bug report #16841

geoprocessing tool "Split Lines with lines" fails if vertices do not already exist when lines touch each others

Added by Jean-Gabriel JGH almost 7 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:2.18.9 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:24740

Description

I am running the tool "Split Lines with lines" on a single layer (that is, the line layer is both the layer to be cut and the blades). There is an issue when the lines touch each others. It works great when the lines to be cut have a vertex at the intersection point, but if they don't have this vertex then the line is not cut.

Step to reproduce (faulty case):
- Create a temporary line layer
- Draw one random straight line (so with vertices at start / end points only)
- Enable snapping to segment
- Draw another line with start point not touching the 1st line and the endpoint being snapped in the middle of the 1st line
- Run "Split Lines with lines" tool
--> Result: the 1st line is not split at the intersection point

Step to reproduce (working case):
- Create a temporary line layer
- Draw a random line having a vertex between the start and end point (so 3 vertices in total)
- Enable snapping to vertex
- Draw another line with start point not touching the 1st line and the endpoint being snapped to the vertex of the 1st line
- Run "Split Lines with lines" tool
--> Result: the 1st line is split at the intersection point

vertex3.png - Illustration of faulty and working configurations (15.3 KB) Jean-Gabriel JGH, 2017-07-10 09:23 PM

History

#1 Updated by Giovanni Manghi almost 7 years ago

  • Status changed from Open to Feedback
  • Operating System deleted (windows 10 64bits)

This is not completely unexpected to me, considered that for example not even PostGIS does the split of a line with points or lines if in the touching spot there isn't a node. As the underlying libraries are probably the same (GEOS?) the "issue" is probably the same... the solution, at least in PostGIS, is to add a node where the lines (or lines and points) are touching, see for example:

https://mygisnotes.wordpress.com/2017/01/01/split-lines-with-points-the-postgis-way/

#2 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Feedback to Open

#3 Updated by Alexander Bruy about 6 years ago

IMHO this should be closed as this is expected behavior (e.g. PostGIS also needs vertices to split).

#4 Updated by Alexander Bruy about 6 years ago

  • Status changed from Open to Feedback

#5 Updated by Nyall Dawson almost 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF