11

I would like to be able to show a basic style for a layer at a large scale, e.g. GB-wide, with all polygons the same, but for this to change at a smaller scale, e.g. 1:25K, to differentiate between polygons.

Ideally I would like to be able to do this without changing the style/loading a saved style, each time I change scale.

Is this possible?

2
  • 3
    Open the same data as two separate layers and set the scale ranges from Properties-General-Scale dependent visibility so that only one layer is visible at any scale.
    – user30184
    Jan 9, 2018 at 10:14
  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq.
    – underdark
    Jan 9, 2018 at 18:56

1 Answer 1

23

Yes, it is possible.

What you need is rule-based Styling with a scale rule as shown in the image (sorry for german layout) enter image description here

It looks like this when you zoom in and out : enter image description here keep in mind, that when you zoom out of the defined zoom levels, the layer won't be shown.

EDIT:

To have different styles within a category you can refine the rules by right-clicking on a rule -> Add scale and set different scales. In order to make this work you need to make the "parent rule", which defines the classes transparent.

To have the layer look the same you can add a rule without a filter and set the scale to be smaller as the scales defined by the classes (see image 3 for the setup and image 4 for the result)

enter image description here

result: enter image description here

5
  • That's great, thank you. Is it possible to then 'categorise' the polygons by a field, within the Rule-based option? I will potentially be displaying dozens of polygons at any one time, and would like to be able to categorise them so that each is a different colour, without haven't to change the colour for each polygon/field manually.
    – JimS-W
    Jan 9, 2018 at 10:56
  • 1
    @JimS-W yes thats what I did with the rule "id" = 1, "id" =2 and so on. Id can be any field in your shapefile (see my edit)
    – LaughU
    Jan 9, 2018 at 11:40
  • Thanks @LaughU. I've found it is possible to do what I'm after by refining the rules (within the Rule-Based option) by right-clicking on a rule -> Refine Current Rule -> Add categories to rule, and then classifying by feature ID. Unfortunately it looks like it's not going to be usable for this particular layer, as there are so many polygons that it keeps crashing QGIS, but it will be very useful for other layers I am working on.
    – JimS-W
    Jan 9, 2018 at 11:44
  • "keep in mind, that when you zoom out of the defined zoom levels, the layer won't be shown." Does QGIS have an "otherwise" or "default" feature for this case?
    – jpmc26
    Jan 9, 2018 at 22:32
  • 1
    @jpmc26 I don't know if QGIS has a default value but a workaround could be to wrap your zoom levels with something like from 1:100.000 to 1:100.000.000 to ensure it will be shown on a reasonable scale no matter how far you zoom out
    – LaughU
    Jan 10, 2018 at 8:54

Your Answer

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

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