1

I want to create a map series controlled by atlas, but some of my features have very different scales. I want to insert a condition to never use a scale lower than X (for instance: 1:5000). Any idea?

This is the result for one of the maps that zooms too much because it is shown just one point in the map.

enter image description here

1 Answer 1

4

In Main Properties tab -> Scale -> Data Defined Override, you need to write the following expression:

case 
when @map_scale < 5000 then 5000
else @map_scale
end

The above means that if the scale that fits the feature is less than 5000 then use the scale of 5000, and if the scale that fits the feature is more than 5000 then use the best fit.

The above expression will prevent the scale to zoom in more than 5000.

For example, I am using data from Natural Earth Data (UK Boundary) to test the above expression (but for this case I used a scale of 50,000):

Without the above expression, the best fit for Bristol County is 39,688 as you can see below:

enter image description here

After applying the above expression with 50,000 instead of 5000 (as in your case), Bristol County zoomed out to 50,000 and it cannot be zoomed in less than the defined scale:

enter image description here

0

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.