In a previous post, I showed how to use the aggregate function to find neighbor polygons using QGIS. Using aggregate functions on the same layer allows us to easily do geoprocessing operations between features of a layer. This is very useful in many analysis that would typically require writing custom python scripts.
Here I demonstrate another powerful function array_foreach
that allows one to iterate over other features in QGIS expressions – enabling even more powerful analysis by writing just a single expression.