Bug report #12212

Multiparts to singleparts fails with one-vertex lines

Added by Daan Goedkoop about 9 years ago. Updated over 8 years ago.

Assignee:Victor Olaya
Affected QGIS version:2.6.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20401


It is possible to construct lines containing just one vertex, by removing all vertices from a line except one.

However, QgsGeometry.fromPolyline() returns "None" if such a geometry is used as an argument.

Therefore, if a multipart geometry contains a feature of which one of the parts is such an (invisible) one-vertex line, the "Multipart to Singleparts" algorithm fails - both the ftools(?)-version and the processing toolbox version.

As far as I can see, fromPolyline() is just redirected to Geom, so perhaps the "Multipart to Singleparts" processing script should work around this issue.

(In a singlepart layer one could just remove all such one-vertex lines by finding all layer features with length 0, but for multipart geometries this of course doesn't work.)


#1 Updated by Daan Goedkoop about 9 years ago

Geom does not allow such shapes; the vector -> check geometry validity tool does indeed report such single-vertex "lines" as an error. So I guess that it is not a bug at all, that the "Multipart to Singleparts" function/script fails in this case.

However, in node-editing mode, still "Check finished (0 errors found)" is displayed in the lower-right corner. Maybe that is not correct, then?

(My QGis interface is in German, I hope the translations back to English make sense)

#2 Updated by Alexander Bruy over 8 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Works in master. Please reopen if necessary

Also available in: Atom PDF