I have a layer of deforestation, and I need to create many layouts of each one polygon. I'm using Atlas to do it. See the model below:
Yellow polygon in raster is deforestation map layer and it is driver of atlas. Bottom wright we can see map with overview and when it change the box of map will be changed automatically change depend on where overview be.
The map in right and bottom place of paper, I would like that when change the atlas map, the feature (município) of map keep centralized where the overview is into. See the red overview into polygon and this is the geometry that I need to get in order adjust limits of map.
So, I create one expression to get geometry of feature from name of municipio. The layer that drive atlas (desforastation layer map) has column with name of municipio and as with it that I try to get municipio geometry from municipio map layer.
So, I did the expression in extents box data defined override:
See the expression that work to get feature:
I make the expression from deforestation layer, which drive atlas. So, I try to get feature from municipio map layer with column attribute of deforestation map layer (that has the column name of municipio in order to join with municipio map layer). In expression, 'nome' came from municipio map layer and municipio (without '') came from atlas driver layer (deforestation map layer) which has column name of municipio.
But when I continue to get geometry, it doesn't work. It return NULL value as a result. Because of it, it is impossible to calc x_min, and another ones values of map box.
The project to download: link to download
x_min (....)
? and if so, what does the previes say? In case of error, what explanation does it give?