QGIS Atlas – How to Label Only Specific Features

atlaslabelingqgis

I have a shapefile of about 100 streets and another one of all the districts within a city. Some of these streets run over multiple districts. In QGIS, I use the atlas tool to successively print maps of theses streets one by one.

A street running over two districts

How can I only display the labels for the districts under each individual street street in the atlas?

I tried doing this with rule based styling. I tried using the refFunctions pluging and other spatial operators in the field calculator.

Best Answer

Rule label and use the following formula   'Intersects ($ geometry, @atlas_geometry) = 1' to do on districts

You must have created the atlas to use @atlas_geometry enter image description here

Related Question