[GIS] Split polygon into lines

geometry-conversionlinepolygonqgis

I have a polygon layer which looks like this enter image description here.

I used the QGIS multiparts to singleparts tool and also polygon to lines. In both cases i got this type of result

enter image description here.

I want to extract polygon into individual lines like thisenter image description here

Best Answer

You could use line-to-polygon tool (See How can I transform a polygon to a linestring in QGIS?) followed by v.clean command (See http://grass.osgeo.org/grass64/manuals/v.clean.html).