1

I'm trying to generate thematic maps from point layers representing citizen requests using QGIS's Atlas map composer plugin as well as the Mask plugin to target the number of requests per district.

I would like to have the count of requests by district in order to display it in my legend. Unfortunately, this returns the wrong value. I used the expression below in the map composer.

aggregate( 
layer:='DebrisVoiePlubliqueFinale',
aggregate:='count',
expression:=$id,
filter:=intersects(
            $geometry,
            map_get(item_variables('DebrisVoiePublique'), 'map_extent')    
        )

)

See screenshot below. The true value for this rounding is 54 requests.

Any idea why this is not working?

Best regards,

Map canvas Map Composer enter image description here

1 Answer 1

2

I finally found the solution to my problem. It was simply a matter of adding the @atlas_geometry function which allows intersecting the point layer with that of the polygon.

The expression has been simplified from the previous one:

aggregate(
  layer:= 'Point feature layer',
  aggregate:='count',
  expression:=$id,
  filter:=intersects($geometry, @atlas_geometry)
)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.