Monday, September 29, 2014

Join 2 lines in QGIS

There is a useful plugin in QGIS - Join Lines, that can be used to join two lines into one; reversing the direction of vertices of one line if necessary. This can be useful if you want to construct polygons later on from the lines. The following example shows a problem that can arise if generating polygons from lines that have opposing directions.

The screenshot below shows the counter-clockwise digitized direction of a line feature.


The other line feature is digitized in a clockwise direction.


If a polygon is constructed using the QGIS Line to Polygon function, the following polygon will be generated.


Using the Join Lines command

  1. If the Join Lines plug-in is not installed, select Plug-ins | Manage and install plug-ins and install the Join Lines plug-in.


  2. In the map view, select two lines.


  3. Select Vector | Join two lines | Join two lines.


  4. Select Layer | Toggle editing.


  5. Click Save.

    The joined line is saved.
If the joined lines are used to generate a polygon, the following area geometry will be constructed.


No comments: