I've generated some routes with the Network Analysis: Shortest Path (Layer to Point) from the Processing Toolbox (PT). Route files are GPKG.

Now, I am trying to get the tapered buffer, also from the PT, of these routes. In most cases it works fine, but not always.

I received the following error message:

Feature could not be written to Buffered_a8dd9771_152d_4105_b1f4_b16ca36f413d: 
Could not add feature with geometry type GeometryCollection to layer of type MultiPolygon

The problem is only with the tapered buffer. No problem with the normal buffer tool.

I can imagine that the problem is the geometry of the routes, so unsuccessfully I tried:

  • to fix the geometries: sometimes all are fixed and other times some are lost
  • to change the geometry type of the paths from "automatic" to "linestring"
  • to convert to single parts...

The problem only happens when I use an expression for the end width. It works fine with a number but it's not a problem of the expression: it works fine with other routes.

I finally got it: the problem was...me. I generated a few hundred data tables through the processing modeler and later caused a problem with the table names. I needed to add some fields manually and... error: some of the column names were similar to expected but not the same. The bad column name causes a processing error with the tapered buffer expression. I thought based on the error message that the problem was the geometry but it was the field name.

(The clue was here: Feature could not be written to Buffered_a8dd97...)

  • 6
    Please provide (faulty) example data and your exact buffer settings.
    – Erik
    Commented Aug 9, 2022 at 11:21
  • 4
    It seems that the buffer function creates multipolygons for most geometries but for some geometries it has to create geometry collections which probably contain a combination of polygons and lines. For fixing the issue the output layer should be created as a generic geometry type "geometry" in order to accept any kind of geometries. Unfortunately I do not know how to do that.
    – user30184
    Commented Aug 9, 2022 at 12:19
  • 1
    @user30184 maybe via a virtual layer? select tapered_buffer(geometry,0,100,16) from l
    – JGH
    Commented Aug 9, 2022 at 14:11
  • @JHG. Thxs. Is not a virtual layer. Where can I use the expression? I can't run it in the phyton console.
    – david
    Commented Aug 10, 2022 at 7:25


Your Answer

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

Browse other questions tagged or ask your own question.