# **Bg_buffer_multi_polygon**

*geometric-functions bg_buffer_multi_polygon*

## syntax

- bg_buffer_multi_polygon(
*polygon_data_item*,*size*,*nr_angles*)

## definition

bg_buffer_multi_polygon(*polygon_data_item*, *size*, *nr_angles*) results in a polygon data-item with **buffer polygons around each polygon** in the *polygon_data_item*. The resulting data item has the same domain-unit as the *polygon_data_item*.

The *size* arguments indicates the buffer size, which must be a single Float64 value or a Float64 attribute with the same domain as the *polygon_data_item*.

The *nr_angles* arguments indicates how many angles are used to make the buffer angles, which must be a single UInt8 value or a UInt8 attribute with the same domain as the *polygon_data_item*. More angles results in smoother circles but also in more data.

The *bg_* prefix of the function name indicates that the implementation of operator uses boost geometry library, more specifically, the buffer function.

A variant *bg_buffer_single_polygon* with the same signature can be used to buffer single polygons.

## description

The bg_buffer_multi_polygon function can be used as alternative for the polygon-inflated and polygon-deflated functions. The bg_buffer_multi_polygon is much faster, but for complex polygons it might be less accurate.

- Use a positive
*size*argument to increase polygons (outer rings including islands are increased, inner rings (lakes) are decreased). - Use a negative
*size*argument to decrease polygons (outer rings including islands are decreased, inner rings (lakes) are increased).

If only the buffer polygon without the orginal polygon is needed, use the sub-(difference) function the cut out the original polygon from the result of the bg_buffer_multi_polygon function.

The bg_buffer_multi_polygon does not always work correctly with holes and lakes if polygon geometries are not valid. If self-interactions occur in polygons we noticed unexpected results.

We advice to use e.g. QGis to check the validity of your polygons before applying the bg_buffer_multi_polygon function. Within the GeoDMS you can use the [[mul (overlap)]] function (first and second argument are the same) to clean your polygon topology.

If that does not solve the issue, we advice to first use the split_polygon function to make a set with single polygons first and perform the bg_buffer_multi_polygon function on the single polygons.

## applies to

- attribute
*polygon_data_item*with a point value-type and a composition type polygon. - data-item
*size*with a float64 value type (until version 14.11.2 argument*size*could only be a parameter) - data-item
*nr_angles*with a uint8 value type (until version 14.11.2 argument*nr_angles*could only be a parameter)

## since version

8.031

## example

```
attribute<fpoint> polygon_buffer (polygon, district) := bg_buffer_multi_polygon(polyset/geometry, 10.0, 16b);
```

more examples of buffer functions can be found here: Buffer processing