Can't transform lines to polygons

So... I'm answering my own question. I'm just selecting my answer because it's not using GRASS and, at the moment, I'm trying to stick to the QGIS environment (in the future, I'm almost sure I'll need to invest more in GRASS).

So... this is what I've did:

  1. I selected the select attributes by rectangle enter image description here
  2. selected my whole layer enter image description here
  3. Opened the layer attribute table, where I found this: enter image description here
  4. Then turned into edit mode, inverted the selection, deleted those 2 attributes (ID 104 and ID 106), saved and exited edit mode. The table became: enter image description here
  5. After that... just needed to run Poligonize: enter image description here
  6. And... here it is, the final result: enter image description here

Resuming... it was not the "save as" that corrected the layer. It was those 2 attributes (some kind of trash from previous handling of the shapefile) that were corrupting the file logic, after removing them Polygonize was able to run without any kind of trouble.


Cleaning the original shapefile using GRASS v.clean snap from the Processing Toolkit (using a Threshold of 10) produces a line shapefile that can be polygonised using 'Polygonize' also from the Processing Toolkit.

enter image description here


I too faced similar problem when trying to polygonize lines using the "Lines to Polygons" tool. Obtained sliver polygons similar to the above images. But when I tried polygonization using "Polygonize" tool from the Processing Toolbox, got the exact desired polygons. Refer this link