1

Running the polygonize algorithm from the processing toolbox doesn't seem to work if you have a layer with several line objects that you want to polygonize individually. Think two "polygons-to-be" made of self-intersecting lines that also intersect each other. The algorithm takes the intersection of these two polygons as another polygon, creating three polygons in total although there are only two line objects in the layer. Is there a way to polygonize each object in a layer individually?

1
  • Looks like the "Lines to polygons" command from the Geometry Tools menu does this. – Felix Aug 21 '19 at 9:41
0

You can use the polygonize tool and click the green arrow on the right hand side of the input layer parameter, this will force the tool to iterate over all the lines in your layer. Afterwards you will have to merge the results back.

Cheers.

1
  • Ah, thanks, did not see that. Silly me. When iterating over the features with the polygonize tool, I'm getting a weird error, however: File "C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins\processing\algs\qgis\Polygonize.py", line 85, in processAlgorithm fields, QgsWkbTypes.Polygon, source.sourceCrs()) Exception: unknown. But I discovered that iteration is the default behaviour of the "Lines to polygons" algorithm, so I won't worry about this now. The results are quite good. Thanks, anyway. – Felix Aug 21 '19 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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