I have a vector layer with several polyline segments that represent borders of different areas. Each segment is connected to at least two other segments (at its start and its end). Some segments are connected to more then two other segments.
I need to convert those multiple polylines to multiple polygons. (See fig.)
When I use polygonize tool in vector->geometry menu it treats each segment as it's own polygon and makes garbage. (See fig 2)
Merging all segments into a single one doesn't help. Clipping large polygon with lines also doesn't help in this case since line segments doesn't cross the whole large polygon.
This problem seems obvious but I'm stuck. I can do it in GRASS with ease, but I have no idea how to do it in QGIS. I don't mind using Python scripting for this.
Polygonize
tool in the QGIS Processing Toolbox - inQGIS geoalgorithms | Vector geometry tools | Polygonize
. The failed one was probablyLines to polygons
.