QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

North Arrow in Print Layout disappears when resize mode set to 'Zoom and Resize Frame' and map frame has rotation

Open gvellut opened this issue 5 years ago • 9 comments

When I add a North Arrow in a Print Layout and set its resize mode to 'Zoom and Resize Frame' and its linked map frame has a rotation, then if I save the QGZ, exits QGIS and reopen the QGZ, the north arrow no longer displays in the layout. The object is still listed in the items but it does not display on the page (where it used to be). When I look at the position of the north arrow, it is set with 999999.0 in the values :

Screenshot 2020-06-28 at 20 42 17

Here is a saved QGZ (inside a zip) where I already did the steps described below (1 to 6).

ghbr.qgz.zip

How to Reproduce

  1. Create a new QGIS document (leave it empty)
  2. Create a new print layout
  3. Add a map then a north arrow
  4. Add some rotation to the map
  5. Set the resize mode of the arrow to 'Zoom and Resize Frame'
  6. Save and exit
  7. Reopen the QGZ and the layout.
  8. Where is the north arrow??

QGIS and OS versions

I am using QGIS 3.14 on macOS 10.14.

QGIS version 3.14.0-Pi QGIS code revision 9f7028fd23
Compiled against Qt 5.12.3 Running against Qt 5.12.3
Compiled against GDAL/OGR 2.4.1 Running against GDAL/OGR 2.4.1
Compiled against GEOS 3.7.2-CAPI-1.11.2 Running against GEOS 3.7.2-CAPI-1.11.2 b55d2125
Compiled against SQLite 3.28.0 Running against SQLite 3.28.0
PostgreSQL Client Version 11.3 SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.11.1
Compiled against PROJ 5.2.0 Running against PROJ Rel. 5.2.0, September 15th, 2018
OS Version macOS Mojave (10.14)
Active python plugins FreehandRasterGeoreferencer; firstaid; profiletool; quick_map_services; QGIS3-getWKT; QuickWKT; qgis-maptiler-plugin; plugin_reloader; valuetool; processing; db_manager; MetaSearch; CustomToolBar

gvellut avatar Jun 28 '20 18:06 gvellut

Confirmed on Linux (Ubuntu 20.04) that the North Arrow moves / disappears from the print canvas when 'Zoom and Resize Frame' is selected together with 'Sync with Map'.

The issue does not seem to occur for other Resize Modes. Also, if 'Sync with Map' is not selected and 'Image Rotation' is provided manually, it looks like this issue does not occur.

benhur07b avatar Jun 29 '20 21:06 benhur07b

Also confirmed on Windows 10.

A current work-around is to use the marker.

techdude1996 avatar Jul 02 '20 12:07 techdude1996

Also confirmed on Windows 10 in the last LTR Version 3.16.5.

The issue occurs in both .qgs and .qgz project files. The cause is probably that nan is returned and stored in the projectfile:

<LayoutItem uuid="{435ed10e-d0f8-436b-abc5-bcfc130a9981}" frameJoinStyle="miter" positionLock="false" outlineWidthM="0.3,mm" zValue="1" itemRotation="0" svgBorderWidth="0" referencePoint="0" positionOnPage="nan,nan,mm" file="wind_roses/WindRose_01.svg" groupUuid="" northMode="0" type="65640" frame="false" excludeFromExports="0" svgBorderColor="255,255,255,255" visibility="1" size="nan,nan,mm" opacity="1" pictureWidth="nan" anchorPoint="0" mapUuid="{5db86f59-fd5f-47d6-a544-9fb0048f365b}" templateUuid="{435ed10e-d0f8-436b-abc5-bcfc130a9981}" northOffset="0" id="Nordpfeil" mode="0" position="nan,nan,mm" svgFillColor="0,0,0,255" background="false" blendMode="0" resizeMode="3" pictureHeight="nan" pictureRotation="10">

(Extract from the project file (xml) after saving)

fiddlersfan avatar Apr 01 '21 18:04 fiddlersfan

Still valid on QGIS 3.22.3. (Windows 10)

Pedro-Murteira avatar Feb 01 '22 16:02 Pedro-Murteira

In my report, I use a simple arrow to indicate the direction a picture was taken (by reading the EXIF tag - GPSDirection in a plain table where I store the images). This works great, but each time I save and exit, the arrow indeed moves away from the center. It's happening with a simple arrow, or a SVG, which makes me think it's somehow relation only to the "rotation" option ? Hope that helps. Thanks

rotation_bug rotation_bug2

CharlesGag avatar May 02 '22 16:05 CharlesGag

@CharlesGag the current workaround is to use a Marker layout item instead of North Arrow layout item. The marker can be rotated via a data defined override in the rotation tab.

esnyder-rve avatar May 02 '22 18:05 esnyder-rve

@esnyder-rve You are right it seems to be working fine. I tried with an North Arrow AND with a regular arrow (shape) and I had the same inconclusive result with both so I thought the problem was with the rotation tab. I assumed it would do the same with the marker but I was wrong. Thanks for your help

CharlesGag avatar May 02 '22 19:05 CharlesGag

Still happening with 3.30.0-'s-Hertogenbosch, also you are not able to select the item except via the Items panel so you can't drag it around

antoniolocandro avatar Mar 09 '23 23:03 antoniolocandro

Related to https://github.com/qgis/QGIS/issues/57489

YoannQDQ avatar Oct 01 '24 18:10 YoannQDQ

Thanks for mentioning my post.

This issue is still true for 3.34.4 and 3.34.11

Currently I use the "zoom and resize' with manually adding the rotation.

Dominik-CHE avatar Nov 06 '24 16:11 Dominik-CHE