1

I am using QGIS 2.14 and I want to set my contour line lables so that my minor labels (every half a metre) are only shown at a scale under 1:1000, while having all my major (every metre) labels always showing. I assume you can do this in the expression builder - but I am not sure where to find the 'Maximum' function name.

So far I have:

Case
When "Elevation" Like '%.5' THEN ????
When "Elevation Like '%.0' THEN ???
END
3

Try rule based labelling. Can't be 100% sure as I'm on 2.16 but that you can set what scale the labels are shown and I believe that it is available in 2.14 but if you check out this screenshot for 2.12 it is available then: Rule-based labeling and the Data defined placement options are not working together (QGIS 2.12, 2.14)

EDIT: Simplified method

OK having a quick play on 2.16 under 'rendering' in the layer properties you have scale based visibility. Using the data defined option you can set a CASE/WHEN statement on the maximum scale value like:

CASE WHEN "Elevation" LIKE '%.5' THEN 1000
END

This will only show the 0.5 labels with scales under 1000. Again this is on 2.16

  • That worked for me, thanks! Is it not possible to do using the " CASE WHEN" method? – T.O.6 Sep 2 '16 at 9:54

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.