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

1
  • 1
    The green Line must have a gap, otherwise it would form a Polygon.
    – klewis
    Jan 31, 2017 at 17:44

2 Answers 2

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.

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.

2
  • Wow, it's done in a quick single action!
    – Kazuhito
    Jan 30, 2017 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. Jan 31, 2017 at 16:55

Your Answer

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

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