5

I created a polygons layer in QGIS 3.22.2 by creating circular buffers around points.

I need to Union them by intersecting the overlapping parts. After running for several hours, the Union tool gives me this error:

Could not add feature with geometry type MultiLineString to layer of type MultiPolygon.

Tried the Multiparts to singleparts, tried the Fix geometries. It's all still the same. I'm kinda afraid to run any line correcting tool in the layer as it could warp the problematic lines to wrong extents/results. Is there a way to convert line to polygon without affecting it's geometry, just to sort of "redefine" it? I'm sure any line can be defined as polygon. If not, how do I sort out these MultiLineString features?

They should not be in a layer created of polygons in the first place. I don't see any way to sort fields by geometry type. I'm trying now layer/save as/geometry type polygon, and running the Union tool in this layer, but something tells me it won`t work either.

How do I get Union tool to work correctly on layer created of overlapping circular polygons?

7
  • 1
    I use to get that error but the tool still continues
    – BERA
    Jan 12, 2022 at 6:49
  • Don't think so. Intersect will come in the next step, when I'll intersect the Unioned layer with another lines layer which is the final result I need to achieve. Now, with over 10 k initial buffers, relating to over 100 different input values, dissolved then by two values, I need to Union them altogether. That`s the whole idea of the task - summing the values of areas. Thus, any other combination than all buffers together will involve much more manual work than sorting out this multilinestring issue.
    – edge
    Jan 12, 2022 at 7:16
  • Can you try using the SAGA Union tool? Does it make any difference if you save to a geopackage, shapefile, file geodatabase, etc. There seems to be a plausible explanation for why you are getting this error in the answer to this thread: gis.stackexchange.com/questions/229367/…
    – John
    Jan 18, 2022 at 21:59
  • @johns saga's union tool runs without errors. there is no difference in the file format, all do fail. st_makevalid() is not able to fix the issue. Also see gis.stackexchange.com/questions/419841/… for context and an example file.
    – MrXsquared
    Jan 23, 2022 at 14:26
  • Is it possible that the ultimate problem here occurred before the Union tool: that the buffer tool output a MultiLineString layer instead of a polygon layer? When you hover your cursor over the buffered layer in the Tools Panel, what data type does it report (we would expect MultiPolygon)? Can you edit your question to include a detailed description of your workflow: input layers, tools/options used, and output? Can you make source data available?
    – Stu Smith
    Jan 23, 2022 at 16:20

3 Answers 3

4

Came across this recently and the only tool able to fix the issue is v.clean. Run it with default settings and try union on the cleaned result.

0

I had a similar problem and think I finally found the solution. The errors disappeared since the model starts with creating a spatial index and since I removed the step to reproject the layer.

I don't know if you convert between projections but it might be that there's the problem.

0

Use 'multipart to single parts' for the layer, then union the resulting layer.

1
  • The asker says he/she tried multiparts to singleparts and it didn't work. Nov 30, 2022 at 18:40

Your Answer

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

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