I got a river shapefile below,

enter image description here

and I found that there are many fragmental lines in this line shapefile, like,

enter image description here


enter image description here

Most of these are located around the confluence(node), and how can I do to efficiently merge them into the nearby large line object, making whole shapefile containing only intact line segments between confluences(nodes)?

  • Do you have access to ESRI? Assuming that there are no attributes to preserve I would dissolve into a single multipart feature and then planarize in an edit session of ArcMap. I don't know of any function in OGR/QGIS that would perform a planarize but there might be an explode multipart into single part that works in a similar manner. Apr 15, 2014 at 5:50
  • @MichaelMiles-Stimson thanks, I want to use QGIS to do this.
    – Heinz
    Apr 15, 2014 at 6:33

2 Answers 2


QGIS Disolve can solve this issue.

  1. In your river layer, select linestrings you want to merge.
  2. Go to menu and activate Vector | Geoprocessing Tools | Dissolve
  3. Make sure that your river layer is selected as Input layer.
  4. Select option Dissolve all (to dissolve all selected linestrings, without specifying the ID).

If the selected line segments are not intact, Dissolve tool gives a multipart feature. In such cases the line layer has to be topologically cleaned beforehand.


Go to settings Go to snapping options Select river layer Select pixcel from dragdown menu Choose around 10 pixcel for snapping limit.

  • I'm not sure how the snapping option will change the pre-existing data. Please consider expanding the question clearly answering the OP's question. Apr 16, 2014 at 4:47
  • I tried, but like @DevdattaTengshe said, the data seems not change.
    – Heinz
    Apr 16, 2014 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.