3

I'm trying to use "expression based" labeling in QGIS, but I'm stuck with a particular case.

I managed to use it for a project with the help of other topics and FAQ but I'm not skilled enough to take care of this problem alone.

I have 5 layers, one "project" layer with around 10 objects (10 different marinas around rivers in France) and 4 layers for particular water area (different scales) with also polygons. I want to only show labels of those 4 last layers of the polygons that intersect any of my 10 objects of layer 1.

I hope to be clear enough. Any guess of the query I need to use?

Note: I already used the vector selection option and created a new layer with the selection. I'm looking for another option, label based because this is too long. I know there is also a "show/hide" option, but it is not very simple to use in my opinion.

enter image description here

Thank you for your time!

1

Here is an option to only label intersected features:

  1. For each layer that you want to label add another field in the table called something like "intersect"
  2. Run a Spatial Query on each layer to define those features that intersect the project layer
  3. Use Field Calculator to populate a "Yes" value for the selected features (save edits per layer)
  4. Create label expression for each layer e.g.

Expression

"intersect"  =  'YES' 
0

In QGis 1.8 there is the option to only label selected features. Maybe you can perform your task with that?

  1. Configure Layers with wanted labelling, selecting the "only label selected features" checkbox.
  2. Create your selection
  3. Et voila!
  • 1
    Hello, Yes this is a solution I've tried. BUT 3 problems: -this option is not available in 1.9 master (I think); -need to "hide" selection color for printing; -need to select object in each layer (5) manually (a bit long). Looking for a unique solution if possible. Cheers – Arthur Aug 8 '13 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.