I have polygons drawn with AutoCAD as Mline (Multiline type) which are rendered in QGIS as 8 segments for each feature. An example of one selected feature is shown in the picture below:
I want to clean this layer thus to only have the connected segments as polylines. An illustration of the expected result is shown below:
It is not possible to convert them with AutoCAD.
I used the "Multipart to Singleparts" processing to obtain 8 features instead of 1 feature composed of 8 separated segments. Here is my problem, I do not find the process to keep only the connected segments and remove the isolated ones.
Then I tried several procedures:
play with the "v.clean" tool from GRASS, without success.
use the "Shortest path" processing, which is not a solution, as I have too many features.
"reconstruct" polylines by generating some points along lines and connect them automatically by creating new lines lines, with the help of some plugins.
Finally, to circumvent this issue, I also tried to apply the "Buffer" processing on the 8 segments to obtain overlapping polygons. Then, the "Dissolve" processing was applied on the overlapping polygons in order to obtain one polygon describing the former lines originally drawn as multilines. Finally, the use of the "Skeleton/Medial Axis" function of the HCMGIS plugin led to a result close to the one I expected. Unfortunately, three major problems are encountered in following this procedure: loss of accuracy, unexepected small polylines generated at each curvature and a very heavy procedure (crash) for my computer (more than 3000 segments).
Does someone have an idea?