Bug report #7758

Maximum viewing scale

Added by Jonathan Moules almost 10 years ago. Updated almost 4 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:16657


I load a QML file I made with 1.8.0. These are the first two lines:

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="1.8.0-Lisboa" minimumScale="0" maximumScale="5000" hasScaleBasedVisibilityFlag="1">

However, when I "apply" it, the data disappears and my "Maximum (inclusive)" is: -2147483648:1

Using weekly master build 1959182

Topographic_Area.qml (83.5 KB) Jonathan Moules, 2013-05-03 04:11 AM

Related issues

Related to QGIS Application - Bug report #8546: default maximum scale shows nonsense value Closed 2013-09-01


#1 Updated by Jonathan Moules almost 10 years ago

Full QML attached

#2 Updated by Jürgen Fischer almost 10 years ago

  • Subject changed from Maxium viewing scale to Maximum viewing scale

#3 Updated by Giovanni Manghi over 9 years ago

  • Category set to Symbology

It works fine if the qml is saved directly in master?

#4 Updated by Jonathan Moules over 9 years ago

If the file is created from scratch in master, then reloaded later, it works fine. So it seems to just have issue loading older QML files.

#5 Updated by Sebastian Dietrich about 7 years ago

This appears to be a bug within the presentation layer. The style is correctly loaded and applied in current master.

Your maximum scale of 1:0 actually is a special value meaning no upper boundary set, e.g. you can zoom in as much as you want.
This special value can be given to QGIS in many ways:
  • 1:0
  • -2:1
  • -3:1
  • ...
  • -2147483648:1

However we would expect QGIS to always choose the same representation when it displays this special value, e.g. always display 1:0.
But QGIS switches its display between 1:0 and -2147483648:1 with every saving:

  • Open the layer properties dialog
  • Note the maximum scale of 1:0, but do not change anything!
  • Hit OK, the layer properties dialog closes
  • Open the layer properties dialog again
  • Note the maximum scale of -2147483648:1, but do not change anything!
  • Hit OK, the layer properties dialog closes
  • Goto step 1 :-)

#6 Updated by Nyall Dawson about 7 years ago

@Sebastian - we should fix this. Make it so instead of showing these nonsense values we use an understandable string like "No maximum set" (or "No minimum set")...

I've also been thinking that QgsScaleRangeWidget should either silently flip the maximum and minimum scales if the user has entered them backwards (easy mistake to make, especially seeing QGIS isn't consistent how these are used (labeling is opposite to symbology)) OR have some little yellow warning icon come up if the scales are backward.

#7 Updated by Sebastian Dietrich about 7 years ago

@Nyall - agreed. The special value for no lower boundary set seems to be 0, which can also be given as 0:1. This is saved as maximumScale="inf" to the project file.

QGIS isn't consistent

Yes, sometimes scale refers to the actual scale, like 1:5000, and sometimes to the scale denominator, like 5000.

Reading code like this makes me shiver:

dlg->setMinimumScale( 1.0 / layer->maximumScale() );
dlg->setMaximumScale( 1.0 / layer->minimumScale() );

#8 Updated by Giovanni Manghi almost 6 years ago

  • Regression? set to No
  • Easy fix? set to No

#9 Updated by Giovanni Manghi almost 4 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF