Skip to content

Commit

Permalink
Expose QgsBearingUtils to QML
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 27, 2019
1 parent c004f40 commit ddd2c6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions python/core/auto_generated/qgsbearingutils.sip.in
Expand Up @@ -21,11 +21,14 @@ Utilities for calculating bearings and directions.
%TypeHeaderCode
#include "qgsbearingutils.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

static double bearingTrueNorth( const QgsCoordinateReferenceSystem &crs,
const QgsCoordinateTransformContext &transformContext,
const QgsPointXY &point );
const QgsCoordinateTransformContext &transformContext,
const QgsPointXY &point );
%Docstring
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
Expand Down
9 changes: 6 additions & 3 deletions src/core/qgsbearingutils.h
Expand Up @@ -23,6 +23,7 @@ class QgsCoordinateTransformContext;
class QgsPointXY;

#include "qgis_core.h"
#include <QObject>

/**
* \class QgsBearingUtils
Expand All @@ -32,16 +33,18 @@ class QgsPointXY;
*/
class CORE_EXPORT QgsBearingUtils
{
Q_GADGET

public:

/**
* 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 QgsCoordinateTransformContext &transformContext,
const QgsPointXY &point );
Q_INVOKABLE static double bearingTrueNorth( const QgsCoordinateReferenceSystem &crs,
const QgsCoordinateTransformContext &transformContext,
const QgsPointXY &point );

};

Expand Down

0 comments on commit ddd2c6e

Please sign in to comment.