Bug report #11883

text annotation with fixed map position moves

Added by Jochen Huber almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Affected QGIS version:2.6.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20097

Description

When adding a text annotation and using the setting "fixed map position", QGIS rounds or truncates the map position when saving the project file. When loading the project file again, the position is displayed correctly at first, presumably beacause QGIS uses the saved canvas position instead of the map position. When zooming the map, the canvas position seems to be recalculated from the saved map position. Because of the rounding/truncation, this causes the text annotation to move to the corresponding rounded coordinate value.
This does not occur when changing the map scale in the map canvas element settings in the map composer, only when zooming in the main application map window.

Example from project file:
<AnnotationItem frameHeight="35" canvasPosX="686" mapPosX="3.2347e+07" canvasPosY="458.375" mapPositionFixed="1" mapPosY="5.67418e+06" [..]
For mapPosX this means an easting value of 32347000m, so the position of the label may be off by almost 100 meters in the worst case (if the values are truncated) or 50 meters (if the values are rounded).
This is really a problem when creating large-scale maps.
Screenshots with coordinates and an example project are attached.

1-before_zoom.png - original text annotation position (12.6 KB) Jochen Huber, 2014-12-18 02:32 AM

2-after_zoom.png - text annotation position after zooming (20.5 KB) Jochen Huber, 2014-12-18 02:32 AM

Example.zip - example project and data (5.66 KB) Jochen Huber, 2014-12-18 02:32 AM

Associated revisions

Revision f81d4836
Added by Jürgen Fischer almost 10 years ago

annotation items: save coordinates using qgsDoubleToString instead of QString::number (fixes #11883)

History

#1 Updated by Giovanni Manghi almost 10 years ago

  • Category changed from Decorations to Map Canvas

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

  • Status changed from Open to Closed

Also available in: Atom PDF