7

In QGIS 2.14 is there any way of just showing features within the atlas from another layer. In the image the atlas feature is the red "Estates" layer and the blue buildings are the "buildings" layer.

I have created over 30 plans showing different estates. I wish to only see the buildings that are within the estates boundary and none of the others. Is this possible?

enter image description here

underdark
  • 84,148
  • 21
  • 231
  • 413
Paul G
  • 281
  • 2
  • 8

2 Answers2

14

If as @Underdark suggests you set a rule based style using a filter like:

intersects( $geometry , @atlas_geometry )

You will get the effect that you want, though some of my buildings cross the parish boundaries:

without filter:

enter image description here

With Filter: enter image description here

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
  • 1
    If you modify the filter to intersects( centroid($geometry) , @atlas_geometry ) the polygons which only touch the atlas feature at the border, will be left out. – Erik Mar 25 '21 at 09:35
2

You need to spatially intersect the two layers in order to assign an attribute of the estate to the buildings.

If you're using shapefiles, I would suggest doing this in the DB Manger and creating in-memory layers that are used for the Atlas features.

If you're using PostGIS, you can update your buildings table to include the estates value using ST_Intersects

Make sure you have the 'memory layer saver' plugin installed.

You can then follow the solution in this thread: How to filter features in other layers of a QGIS Atlas?

DPSSpatial_BoycottingGISSE
  • 18,790
  • 4
  • 66
  • 110
  • 5
    This is more complicated than it needs to be. It is possible to create a rule-based style that checks if a feature intersects the current Atlas feature. No databases or memory layers needed. – underdark Nov 01 '17 at 18:20
  • @underdark I see the answer posted and just found this: https://mail.queryxchange.com/q/23_236794/labels-rules-with-atlas-layer/ good stuff!! – DPSSpatial_BoycottingGISSE Nov 03 '17 at 15:14