Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Features tool: lines are split also at every self-intersection #14070

Closed
qgib opened this issue Jul 14, 2011 · 29 comments · Fixed by #47306
Closed

Split Features tool: lines are split also at every self-intersection #14070

qgib opened this issue Jul 14, 2011 · 29 comments · Fixed by #47306
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality

Comments

@qgib
Copy link
Contributor

qgib commented Jul 14, 2011

Author Name: jcnotter - (jcnotter -)
Original Redmine Issue: 4087
Affected QGIS version: 3.7(master)
Redmine category:digitising


When you use this function to a location, it splits the polyline at each intersections on the polyline and you get a lot of polylines and not 2 as you want
Example : for separating the return track, you get many little tracks ...



Related issue(s): #29256 (duplicates)
Redmine related issue(s): 21439


@qgib
Copy link
Contributor Author

qgib commented Aug 29, 2011

Author Name: Paolo Cavallini (@pcav)


See also #14126


  • pull_request_patch_supplied was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Dec 9, 2011

Author Name: Paolo Cavallini (@pcav)


  • category_id was configured as 44

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was configured as Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Dec 24, 2011

Author Name: Giovanni Manghi (@gioman)


  • version was configured as master
  • crashes_corrupts_data was configured as 0
  • subject was changed from Split Features to Split Features tool: lines are split also at every self-intersection
  • assigned_to_id was configured as cfarmer

@qgib
Copy link
Contributor Author

qgib commented Dec 24, 2011

Author Name: Giovanni Manghi (@gioman)


see also #14472

@qgib
Copy link
Contributor Author

qgib commented Dec 27, 2011

Author Name: Richard Duivenvoorde (@rduivenvoorde)


don't know if cfarmer is the right person to assign this issue to??

the split feature tool is part of

@int QgsVectorLayer::splitFeatures( const QList& splitLine, bool topologicalEditing )@

(implemented via geos, not via ftools (for what I can see))

the actual bug is that the line is also split on it's self intersections

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from High to Normal

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Jul 13, 2013

Author Name: Giovanni Manghi (@gioman)


seems fixed in master, reopen if necessary.


  • assigned_to_id removed cfarmer
  • status_id was changed from Open to Closed
  • resolution was changed from to worksforme

@qgib
Copy link
Contributor Author

qgib commented Jul 13, 2013

Author Name: Richard Duivenvoorde (@rduivenvoorde)


Still not working for me.

If I open the attached shapefile, containing 1 feature (open feature table to see that).

then set layer in edit modus and then from the 'Advanced digitizing toolbar' use the 'split features' tool.

If you then create a 'cut line' in the middle. I would think that the result would be 2 (two) lines.

But if you open the attribute table, it will show you 15 features. Apperently the line is cut on every place where is intersects itself. To me this looks as not what you want.

OR (Giovanni), do we have different settings? And do you have a setting which I do not have...


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Jul 13, 2013

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from worksforme to

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2014

Author Name: Jürgen Fischer (@jef-n)


  • category_id was changed from 44 to Digitising

@qgib
Copy link
Contributor Author

qgib commented Jun 28, 2014

Author Name: Jürgen Fischer (@jef-n)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - Lower Priority

@qgib
Copy link
Contributor Author

qgib commented Jul 19, 2014

Author Name: Brett Russ (@icycle77)


I'm a new QGIS user and thought I was nuts until I found this bug report. I open a single GPX track in QGIS, convert it to a shapefile, and try to split it into two sections. Before the split feature, the attribute table had 1 entry; after: 75 entries! This is impossible to deal with.

Since this defect is so far down the priority list, is there a workaround we could try in cases where we need to split a self intersecting line? I really don't want to trace new lines over the original GPX/SHP for every subsection of the original.

Thanks

@qgib
Copy link
Contributor Author

qgib commented Sep 12, 2014

Author Name: Brett Russ (@icycle77)


I am setting up Mac OS X 10.9.4 to do QGIS development. I could use a tip or two on where to look to try fixing this issue. Thanks in advance.

@qgib
Copy link
Contributor Author

qgib commented Sep 28, 2015

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi,

Please make a test with the two layers I am attaching.

The layer trajeto_completo_2.shp has one single line and the layer percurso_pedestre_2.shp has 2 lines.

Try to make a Split feature in each of the layers.

Making split in percurso_pedestre_2.shp, I get 3 lines, as expected.

Making split in trajeto_completo_2.shp, what happens is that the split is done at all points where the lines intersect.

I thought I was with the problem of this ticket, but more strange is that does not always happen, and the layer in this example is the same, it was only made the split of trajeto_completo_2.shp in another software, resulting in percurso_pedestre_2.shp.

Can anyone see any substantial difference between the two shapefiles that allows explain this different behavior?

I think one way to fix this issue would be through "Enable topological editing" option of the Snapping Options. If this option was active, then it should do the split at every self-intersection, as a network topologically should not intersect.
However, for example in the case of road viaducts, the lines can cross without intersect, since they are at different levels. So, for these cases, the "Enable topological editing" option should be deselected.

This approach fails only because there may be the two situations in the same layer, and therefore may not be very worthwhile.

It is best to avoid it to happen, because to make the split at self-intersections will be enough to import the layer into GRASS, that will automatically enforce topology.

In any case, this issue seems to me to have some priority.


  • fixed_version_id was changed from Future Release - Lower Priority to Version 2.12
  • 9117 was configured as split.zip

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2015

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id removed Version 2.12

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 0
  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Mar 2, 2019

Author Name: Giovanni Manghi (@gioman)


@qgib
Copy link
Contributor Author

qgib commented Mar 5, 2019

Author Name: Thomas Baumann (Thomas Baumann)


The saga tool "split lines with lines" works fine to split lines even if they have self intersections. Perhaps one of the devs could have a look at the saga source code how they manage to split the lines correctly? http://www.saga-gis.org/saga_tool_doc/2.2.7/shapes_lines_6.html

@qgib
Copy link
Contributor Author

qgib commented Mar 5, 2019

Author Name: Giovanni Manghi (@gioman)


  • version was changed from master to 3.7(master)
  • description was changed from When you use this function to a location, it splits the polyline at each intersections on the polyline and you get a lot of polylines and not 2 as you want
    Example : for separating the return track, you get many little tracks ... to When you use this function to a location, it splits the polyline at each intersections on the polyline and you get a lot of polylines and not 2 as you want
    Example : for separating the return track, you get many little tracks ...
  • status_id was changed from Reopened to Open

@qgib
Copy link
Contributor Author

qgib commented Mar 11, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Pedro Venâncio wrote:

Hi,

Please make a test with the two layers I am attaching.

The layer trajeto_completo_2.shp has one single line and the layer percurso_pedestre_2.shp has 2 lines.

Try to make a Split feature in each of the layers.

Making split in percurso_pedestre_2.shp, I get 3 lines, as expected.

Making split in trajeto_completo_2.shp, what happens is that the split is done at all points where the lines intersect.

I thought I was with the problem of this ticket, but more strange is that does not always happen, and the layer in this example is the same, it was only made the split of trajeto_completo_2.shp in another software, resulting in percurso_pedestre_2.shp.

Can anyone see any substantial difference between the two shapefiles that allows explain this different behavior?

I think one way to fix this issue would be through "Enable topological editing" option of the Snapping Options. If this option was active, then it should do the split at every self-intersection, as a network topologically should not intersect.
However, for example in the case of road viaducts, the lines can cross without intersect, since they are at different levels. So, for these cases, the "Enable topological editing" option should be deselected.

This approach fails only because there may be the two situations in the same layer, and therefore may not be very worthwhile.

It is best to avoid it to happen, because to make the split at self-intersections will be enough to import the layer into GRASS, that will automatically enforce topology.

In any case, this issue seems to me to have some priority.

This is still true in QGIS 3.x

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality labels May 24, 2019
@Gusterson
Copy link

Still an issue in QGIS v3.8

@styrke10
Copy link

And still an issue in QGIS 3.15.0-Master...

I have tested on temporary scratch layers and PostGIS layers... Both will split a linestring at every intersection, if splitting at any point.

@paalmiso
Copy link

I've just spent debugging this problem whole day until I've found this open issue. Is there any data I can offer to help diagnose this problem?

@ainthek
Copy link

ainthek commented Oct 29, 2020

uff, same problem here on 3.15.0-Master.
Any workaround ? another algorithm ? way to reconstruct single lines back ?
I have overlaping polylines, and I need to split them on overlap points. from 2 lines I get 2000 lines, instead of 4.
thanx ;-(

@Sneeci
Copy link

Sneeci commented Apr 13, 2021

I have currently the same issue using it on my builder : https://gis.stackexchange.com/questions/393228/qgis-using-split-lines-with-lines-makes-unwanted-cut-on-self-overlapping-lines
Anyone managed to avoid this problem?

@Pedro-Murteira
Copy link

Still valid on QGIS 3.22.3. (Windows 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants