[Qgis-user] Merge Selected Features creates 2 parts

Stewart Holt stewartbholt at gmail.com
Wed Aug 19 17:48:56 PDT 2020


I am using QGIS 3.14.1-Pi on Windows 10. I wanted to merge 107 line
features into one feature. The features are in a Line
(MultiLineString) shapefile.
I selected the layer, put it in edit mode, clicked Invert Selection, and
then clicked "Merge Selected Features" from the advanced digitizing
toolbar. The feature count dropped to one as expected but I noticed
something unexpected. Before discovering that the line segments did not
have to be oriented in the same direction to be merged, I had added an
additional triangle symbol at the end of the line to help with flipping
them. After the merge there were 2 triangles remaining. One at the end and
one somewhere in the middle but only one line feature. Using shpdump from
shapelib, I verified that there was one shape but with 2 parts. The
original file had 107 features, each with only one part. In an attempt to
outsmart it I split the parts into separate features and then merged them
but the result was the same.

I wondered if there was a limit on the number of points in a feature and
that was the cause for the split. I did a wc count on the output of shpdump
and got 33207. The point count would be only slightly less than this number
and would be over the size of a signed, 16 bit integer, but I see no 2 byte
integers in the shapefile format. Even the file type is 4 bytes. I just did
a test with only several line features and got the same result.

Would you consider the merge forming 2 parts a bug? I think it would be
preferable for it to not do that even though for many purposes, it might
not cause a problem. I did not find an open issue with a search on GitHub.

Secondary question: Is there any tools in QGIS which list the contents of
the shapefile.shp like shpdump can? There are many aspects of a shapefile
such as whether it M and Z values, etc and it is useful to get an
understanding of the data.

Thanks,

Stewart Holt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200819/19920181/attachment.html>


More information about the Qgis-user mailing list