I have line segments that have the following 3 attributes (Class, start_point, end_point). I would like to merge/dissolve line segments that fall within the same class if they intersect (touch).
i.e. if the end_point of one line segment and the start_point of another line segment are the same (similar values). (NB. I would like to dissolve lines with the same class value. The dissolve field can also be a new field which will be generated when streams meet the above condition: ie they fall within the same class as well as the end_point of one segment = start_point of another segment)
The circled numbers represent the class (order) of the streams. Each segment has a corresponding class number as shown. The segments circled in red should be dissolved separately. The same should be done for the segments circled in green. Each segment has a start_point and an end_point. For example for the segments in yellow the end_point of one segment and the start_point of the other coincide.
The lower segment circled in red should not be dissolved with the lower segment circled in green because only their end_points coincide.
How can I proceed to do this in QGIS?
Answer
@Miro, I must say thank you again. I used your approach again and found another tool that helps i.e. "split lines with lines". For every class(order) I intersect it using the next higher order. So finally the approach I used is;
Dissolve (dissolve everything with the same class)
Multipart to singleparts (will break lines which are not touching to single lines)
Extract each class (order) of stream (therefore creating new shapefiles for each stream order)
From the processing toolbox, Use the "Split lines with lines" tool - Intersect each class with a higher class.
The results are as expected.
No comments:
Post a Comment