Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[composer] Allow syncing pictures to true north
Previously pictures could only be synced to grid north, which can be totally wrong for many CRSes (especially in polar areas) Users now are given a choice of grid or true north, and can also enter an optional offset to apply if eg magnetic north is instead desired. When synced to true north the bearing is calculated using the centre point of the linked map item. Fix #192, #4711 This fix was sponsored by the Norwegian Polar Institute's Quantarctica project (http://quantarctica.npolar.no) and coordinated by Faunalia. (cherry-picked from 89cc645)
- Loading branch information
Showing with 478 additions and 10 deletions.
- +39 −0 python/core/composer/qgscomposerpicture.sip
- +1 −0 python/core/core.sip
- +21 −0 python/core/qgsbearingutils.sip
- +37 −0 src/app/composer/qgscomposerpicturewidget.cpp
- +2 −0 src/app/composer/qgscomposerpicturewidget.h
- +2 −0 src/core/CMakeLists.txt
- +1 −0 src/core/composer/qgscomposeritemcommand.h
- +73 −6 src/core/composer/qgscomposerpicture.cpp
- +47 −0 src/core/composer/qgscomposerpicture.h
- +51 −0 src/core/qgsbearingutils.cpp
- +45 −0 src/core/qgsbearingutils.h
- +36 −3 src/ui/composer/qgscomposerpicturewidgetbase.ui
- +1 −0 tests/src/python/CMakeLists.txt
- +60 −0 tests/src/python/test_qgsbearingutils.py
- +62 −1 tests/src/python/test_qgscomposerpicture.py
|@@ -0,0 +1,21 @@|
|* \class QgsBearingUtils|
|* \ingroup core|
|* Utilities for calculating bearings and directions.|
|* \note Added in version 2.18|
|* Returns the direction to true north from a specified point and for a specified|
|* coordinate reference system. The returned value is in degrees clockwise from|
|* vertical. An exception will be thrown if the bearing could not be calculated.|
|static double bearingTrueNorth( const QgsCoordinateReferenceSystem& crs,|
|const QgsPoint& point );|
Oops, something went wrong.