Saturday, 14 April 2018

Joining segments of a line in QGIS?


I have lots of different lines composed of hundreds of segments in a Shapefile.


I would like to join them spatially where every start (or end) point of a segment correspond exactly (or within a range of X mm, but this extra) to the start (or end) point of an other segment. And only there. In other word everywhere a segment touch an other at his beginning or ending, they should be joined. (Attributes are always the same except for one column with specifics IDs I don't care about.)


The dissolve tool doesn't work; it compose a unique feature containing absolutely all lines, even those which are far away. All the segments are entire features, so the "multi to single part" vector tool doesn't work either. I have also tried the "Join Lines" and "Join multiples lines" plugins; they both don't do the job. Except the "Join Lines"; it is doing it correctly, but I have to select manually two segments then click to join them. It's not possible to do so manually of hundreds of them.



It would be nice if this can be done on a selection as there is several types (rivers, roads, paths, etc) of lines in this Shapefile.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...