1

I'm working with OSM data in QGIS 2.10 (Ubuntu). I'd like to label items depending on scale. What I mean to do is to have

  • only labels of "primary" roads from a scale of 1:80.000 down to 1:50:000
  • all the other labels from 1:50.000 down to 1:1.000

The only expression about labeling that sounded helpful was:

CASE WHEN "place" in ( 'city','town' , 'village' , 'suburb' ) 
THEN 0
ELSE 1
END

But it doesn't exactly do what I'm looking for.

Does anybody know what I should do?

1 Answer 1

1

You can define the $scale function within your case statement. So you could use something like:

CASE
WHEN "place" in ('city','town' , 'village' , 'suburb') AND $scale <=80000 AND $scale >= 50000
THEN 1
WHEN "place" in ('city','town' , 'village' , 'suburb') AND $scale <50000
THEN 0
END
1
  • Ok, I got the sense of it, but it doesn't seem to be working... I'm trying to export the "primary" roads to a new vector so that I can exclude the others. Thanks for your help!
    – SaraZanni
    Commented Oct 13, 2015 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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