[GIS] Merging two segments with overlapping nodes in QGIS

linemergeqgisshapefile

I have two line segments that overlap nodes. I want to select them, and merge them into one complete segment, so that the overlapping nodes are combined to one node.

Best Answer

If the nodes of the two lines are snapped to each other, then select the two lines and use Merge Selected Features Tool which its icon is shown below

enter image description here

Then a prompt menu will appear to tell you which feature's attribute you are going to use. Please note that after merging the two lines, the vertex will not disappear, the vertex the connect the two lines will still exist because it depends on the angle between two lines. However, if you want to completely remove the vertex to completely turn it into a straight line, then you simply need to go to select Node Tool - as shown below - and click on the vertex that you want to delete until it turns to blue color, then press delete on your keyboard to delete the vertex completely after merging.

enter image description here