Bug report #11883
text annotation with fixed map position moves
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.
Associated revisions
annotation items: save coordinates using qgsDoubleToString instead of QString::number (fixes #11883)
History
#1 Updated by Giovanni Manghi about 10 years ago
- Category changed from Decorations to Map Canvas
#2 Updated by Jürgen Fischer about 10 years ago
- Status changed from Open to Closed
Fixed in changeset f81d48368765a54ac2a5191326210b993f43fdfa.