Reputation: 23
I'm creating an atlas of bus route maps in QGIS, and my goal is to show points of interest within a certain distance of a given route's line. I have 3 layers of note:
routeLayer
: LineStrings of routes. Contains a string attribute route
that is also used as the title of each page of the atlas.bufferLayer
: Hidden polygons surrounding each line in routeLayer
, created with the Buffer tool. Also has route
attribute.pointsOfInterest
: Point layer. I want points to visible only if they're within the bufferLayer
polygon that corresponds to the active route
in the atlas.In the symbology editor, I tried to use the following filter expression:
overlay_within('bufferLayer_[id]',filter:=route= @atlas_pagename )
Unfortunately, this always returned 0 features when I test the expression, so something was off. But here's where I got confused: If I set the atlas to an example route C51
and manually set the filter to
overlay_within('bufferLayer_[id]',filter:=route= 'C51' )
it works! What's more, in the Expression Builder, @atlas_pagename
indicates it's returning the correct thing:
So what gives? Is there something about @atlas_pagename
that prevents it from being evaluated inside an overlay
function? If so, is there some other way to accomplish what I'm trying to do? Is there something else I'm missing?
Thanks!
Upvotes: 0
Views: 18