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.
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
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.
There are a few options, here are two:
1 - Entire Dataset:
Using SAGA tools in QGIS, select >vector line tools>line dissolve.
Input the line and the attribute you want to dissolve.
2 - Selection of lines:
Go to the plugin manager.
Join multiple lines
Permanently join multiple lines
After selecting multiple features of a line layer, this plugin can merge them into one feature with a continuous line.
The plugin will automatically put the selected lines in a geographically logical order and direction. If the end points of two lines do not match exactly, a line segment between both points is added to make the end result a single, continuous line. The attributes of the new line will be those of one of the selected features, but one cannot predict which one.
After testing the tools I listed above, it is clear that the merge tool is the best solution for this question. The join lines tool doesn't get rid of the node, and the dissolve tool doesn't merge the lines.
If you want to automate this workflow, and have some python knowledge, you can select nodes that overlap and merge them in a loop. Then you can merge the whole dataset at once instead of by individual selections. When I have time I will look at producing some code.