[QGIS-Developer] Overlay expression function without a current object

Andreas Neumann a.neumann at carto.net
Wed Jul 13 00:33:43 PDT 2022


Hi,

I would like to use the "overlay_within" expression function, but in 
layout context - and in this case I dont have a "current_feature".

The goal is to find out the municipality from the map center of my main 
map in the layout (but not in atlas context).

What I tried:

-----------

with_variable(
   'current_geometry',
   make_point(
     x( map_get( item_variables( 'Hauptkarte'), 'map_extent_center' ) ),
     y( map_get( item_variables( 'Hauptkarte'), 'map_extent_center' ) )
   ),
   overlay_within(
     layer:='Gemeindegrenzen',
     expression:=gemeindename
    )
)

------------------

But apparently the "overlay_within" geometry function needs a 
"$currentfeature" - which I don't have, but could create artificially 
with make_point from the map center.

Is there any way to "artificially" create a "$currentfeature", so that 
my overlay expression function would work?

Thanks for any ideas,

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220713/efce599b/attachment.htm>


More information about the QGIS-Developer mailing list