6

Does anybody know how to only label features of a shapefile that are inside of another shapefile's features used as coverage in Atlas?

MrXsquared
  • 34,292
  • 21
  • 67
  • 117
Daniel Grisotto
  • 359
  • 3
  • 8

3 Answers3

11

For your case, that the current layer and the coverage layer don't share a similar field, you will need to use the following rule:

within($geometry, @atlas_geometry)

Some extras

If the current layer and the coverage layer share a similar field, then you can use:

"my_field" = attribute(@atlasfeature, 'atlas_similar_field_name')

Finally, if the layer you want to filter is the coverage layer, then you can use this one:

$id = @atlas_featureid

Alexandre Neto
  • 14,212
  • 2
  • 58
  • 85
0

I have never use it but the plugin "Mask" seems to claim to be able to do just what you want.

you could install it from the Plugin manager or go to https://github.com/aeag/mask for the qgis 3 version and to https://github.com/aeag/mask/tree/qgis2 for qgis 2

J.R
  • 16,090
  • 1
  • 19
  • 52
0

To be sure

  • in case CRS are different
  • don't want touching features

then

intersects( POINT_ON_SURFACE( $geometry ) , transform( @atlas_geometry, 'EPSG:7844','EPSG:7855' ) )=1

BJW
  • 487
  • 2
  • 14