I'd like to add a layer in QGIS, not just filtered by attribute, but using a spatial relationship.

For example, visualize only river features that are within the state of São Paulo, Brazil.

How can I do this in QGIS without having to create a new shapefile and cut that data to the state?

  • 1
    Perhaps this post might help: Rendering based on layer overlap qgis?
    – Joseph
    Commented Nov 22, 2016 at 15:45
  • 1
    You can use a ruled-based style and as a rule use the following: within( $geometry, geometry( get_feature( 'State_Layer_name','State_name_attribute','Sao Paulo')))
    – Victor
    Commented Nov 22, 2016 at 17:54


Browse other questions tagged or ask your own question.