2

I'm trying to merge three polylines in order create a polygon out of the surface bordered by them. On the picture attached, it's the region between the green, yellow and red (dotted) line that I would like to transform into a polyline.

I know two line segments can be joined into one line (How to merge lines with slightly different endpoints in QGIS?), but how can I join them if the second line doesn't end anywhere near the other?

I'm working with QGIS 2.14.3-Essen, on a Mac (as one can see from the picture attached).

Hope someone can help me with this.

polylines to polygon

When the "Polygonize" algorithm is executed, a polygon is created of different regions, as you can see in the photo attached.

Polygonized result

And if I run the "Lines to Polygons" function I get this result:

lines to Polygons

2 Answers2

2

One advantage you have here is that these three lines crosses each other, which intersections can be used as cutting points. In three steps:

  1. Merge all lines into one layer.
  2. Cut them into segments at intersected points. To do this, activate QGIS Processing Toolbox | QGIS geoalgorithms | Vector overlay tools | Split lines with lines and provide the subject layer to both Input layer and Split layer.
  3. Join them together by a plugin Join Multiple Lines which gives an single Multistring (polyline).

To convert it (polyline) to polygon, you can use Vector geometry tools | Lines to polygons.

Kazuhito
  • 30,746
  • 5
  • 69
  • 149
1

Do you see a "polygonize" algorithm listed in the processing toolbox? Running that algorithm on a merged layer containing the 3 linestrings should give you what you're after.

ndawson
  • 27,620
  • 3
  • 61
  • 85
  • Wow, it's done in a quick single action! – Kazuhito Jan 30 '17 at 23:27
  • Thanks for your help, although I did not get the result as I was hoping for. When I execute the "polygonize" algorithm, a polygon is created from other regions, as will be shown in a picture I add to my initial question. – mathias dhaen Jan 31 '17 at 16:55