I'd like to make a polygon shapefile out of a polyline shapefile showing a graticule.

However, using the "Line to Polygon" tool results in a peculiar...something:

enter image description here

Other standard tools like "Buffer" etc. seem to work just fine with the polyline shapefile. Anyone experienced this before?


I've just added another latitude to close the graticule and then used "Polygonize". It reached 50% and then crashed:

enter image description here

The log says: "Uncaught error while executing algorithm Traceback (most recent call last): Traceback (most recent call last): File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 202, in execute self.processAlgorithm(progress) File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\algs\Polygonize.py", line 87, in processAlgorithm total = 50.0 / float(len(polygons)) ZeroDivisionError: float division by zero"

If there is something wrong with the original script, what can I do?

Edit 2:

Using "Polygonize" with the cleaned vector layer resulting from "v.clean" gives me the following as a result:

enter image description here

The "v.clean" error layer is completely blank. Which tool should I use in order to split the resulting lines from "v.clean" at each intersection with another line?

1 Answer 1


"Line to Polygon" close each line to make a polygon, doesn't polygonize all closed regions.

You need to use the "Polygonize" tool in the Processing toolbox.

enter image description here

Before using it, make sure all lines are closed.

  • Thanks for the advice, but now there is a new error (see original post).
    – T. K.
    Commented Apr 1, 2014 at 9:04
  • That error means that it couldn't create any polygon. This used to be related with a noding problem. Try to use v.clean with the 'break' option in the Processing toolbox, then polygonize the new layer generated. It will add nodes on intersections and split all linework. Maybe could help. Commented Apr 1, 2014 at 15:08
  • I followed your advice, you can see the results above. We're getting closer to resolving this! ,-)
    – T. K.
    Commented Apr 2, 2014 at 8:30
  • Mmm... those lines should be split. Have you try increasing the threshold in 'v.clean'? Commented Apr 2, 2014 at 9:11
  • Yes. I used 0.1 (default value) but also 10 and 100 (map units). It didn't make any difference, the result is still the same.
    – T. K.
    Commented Apr 2, 2014 at 9:49

Your Answer

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

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