# Aggregation of buffers from polygons

I need to make a buffer from the polygon layer with a specific value in the A field, such as from the X value, for example from the value X.

The buffer must be of radius 50m and I need to get an aggregated polygon from buffers with a minimum of 5 objects that intersect.

Any solutions? I want to do it with a field calculator and geometry with an expression.

• Please Edit the Question to include a graphic that explains your goal. Oct 9, 2023 at 16:18
• What have you tried and where are you stuck?
– PolyGeo
Oct 9, 2023 at 19:36
• I have made a command for the buffer, but I don't know how to aggregate them, because there is an intersection of buffers and there must be a minimum of 5. I tried with the aggregation command, but I failed. Oct 9, 2023 at 19:39
• Hi. First, remember you will allways have the same amount of outputs than inputs in the field calculator. If you have 10 rows, you will have 10 outputs. Next, you are looking for an iterative or clustering algorithm, not an aggregate. You want to see what other buffers intersects with the current one, but also what others intersects with the ones that intersects with the current one, and so on until no more intersections are found. Python and/or Sql are more appropiate than expressions engine for that. Oct 9, 2023 at 23:37
• As @GabrielDeLuca says, it's going to be hard using geometry by expression. If you were using point data (possibly you are not?) then v.cluster with DBSCAN2 might do what you are after, at least on the grouping side. Oct 10, 2023 at 3:32

## 1 Answer

1. Create centroids of each building/polygon:

1. Use the count points in polygons tool/algorithm:

When you open the attribute table of the "count" layer, at the end you will find a field name "NUMPOINTS" which is the number of points in each polygon buffer. You will then be able to remove the remove the buffer you do not need.

In my case for the sake of demonstrating polygons with less than 5 points, meaning less than 4 buildings:

If you need to re-run the process, it is easier to use the graphical modeler than trying to use the field calculator.