Bug report #20133

map composer scale error

Added by Loïc Bouffard over 1 year ago. Updated over 1 year ago.

Category:Map Composer/Printing
Affected QGIS version:2.18.24 Regression?:No
Operating System:win 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27954


I met a problem of precision of my map composer's scale on different version. Always not solve on v3.2.
After making many tests, I found this.
There is always an error on the composer scale, not big but several tenth of percent. The more my map is large, the less the error is. With round numbers, error is very small and sometimes null but when I increase manually map width (size and position pannel) and tend to the upper round number, error is reaching until I exceed it. At this time the scale map factor automatically change (in main property pannel) and error is again at its minimum. If I continue to increase width map, error is growing until I reach following round number, etc... And error is proportionnaly bigger for little map width.

For my tests:

map width -> error
1 mm 0%
1,99 mm 99%
2 mm 0%
2,99 mm 50%
3,99 mm 33%
9,99 mm 10%
298,99 mm 0,337%
1000 mm 0,1%

My conclusion is that the error is due to the difference of format number between map size (float) and scale factor (integer).
Maybe it's wrong but the facts are here and it's a bit annoying when we need precision.

scale1.jpg - map width 220,000 (474 KB) Loïc Bouffard, 2018-10-18 09:16 AM

scale2.jpg - map width 220,999 (498 KB) Loïc Bouffard, 2018-10-18 09:16 AM

Associated revisions

Revision 0a662576
Added by Nyall Dawson over 1 year ago

[layouts] Show more precision in map scale for map item properties

Previously we would often round the scale displayed to the nearest
integer. Now ensure that the map scale widget shows more decimals
to allow verification that the actual map scale exactly matches
the desired scale.

Fixes #20133


#1 Updated by Nyall Dawson over 1 year ago

  • Assignee deleted (Nyall Dawson)

#2 Updated by Nyall Dawson over 1 year ago

  • Status changed from Open to Feedback

Please test with 3.3

#3 Updated by Loïc Bouffard over 1 year ago

I'm sorry it's the same.
Look at pictures linked (done with v3.3): scale bar locked at its left on 0 (line color blanked, just real scale bar visible), right side is ajusting when map width is changing; scale bar is showing 200 m with scale factor=1000 so my scale bar must be 200mm long.
On "scale 1" almost ok when map width = 220,00 mm(guide to 199,984mm), on "scale 2" right guide = 200,892 mm for a map width = 220,999 mm

#4 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Feedback to Open

#5 Updated by Nyall Dawson over 1 year ago

https://github.com/qgis/QGIS/pull/8233 fixes this for me -- it's an issue with precision in the widget showing the current map scale, not in the scalebar/map extent calculation.

Note that for testing you need to ensure that you have NO ellipsoid set in your project properties, or the scale bar will utilise a more accurate ellipsoid based distance calculation but this won't exactly match the results you'd except on purely cartesian scale calculation.

#6 Updated by Nyall Dawson over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF