How to Polygonize a polyline shapefile in QGIS 2.2?

It is not a problem of the old Polygonizer plugin vs Processing:Polygonize (script /plugins/processing/algs/qgis/Polygonize.py).

Both use the Python module shapely and the function polygonize

Sequences of touching lines can be merged into MultiLineStrings or Polygons using functions in the shapely.ops module (shapely.ops.polygonize(lines), shapely.ops.polygonize_full(lines), etc.)

The important here is the touching lines. The final result depends on the precision of the nodes (are the lines really touching ?) and the order of the lines in the layers

Example of results with shapely:

The lines

enter image description here

some results of polygonize according to the criteria mentioned:

enter image description hereenter image description here


According to this Topic: How to go with...somewhat complex geological maps in QGIS? the polygonizing in QGIS 2.2 fails due to some problems with the shapely library. It is fixed in current Master QGIS 2.3.0 using pythons-shapely 1.2.18-1.

Unfortunately, it does not work with QGIS 2.2.0 from the same OSGEO4W setup. So we have to wait for the stable QGIS 2.4. According to http://qgis.org/en/site/getinvolved/development/index#road-map this should be in June. So not far away.