Skip to content

Commit

Permalink
Add utility class for proj to Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 27, 2019
1 parent a1a8e92 commit 545e8bc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
37 changes: 37 additions & 0 deletions python/core/auto_generated/qgsprojutils.sip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsprojutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsProjUtils
{
%Docstring
Utility functions for working with the proj library.

.. versionadded:: 3.8
%End

%TypeHeaderCode
#include "qgsprojutils.h"
%End
public:

static int projVersionMajor();
%Docstring
Returns the proj library major version number.
%End
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsprojutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
%Include auto_generated/qgsprojectstorageregistry.sip
%Include auto_generated/qgsprojecttranslator.sip
%Include auto_generated/qgsprojectversion.sip
%Include auto_generated/qgsprojutils.sip
%Include auto_generated/qgsproperty.sip
%Include auto_generated/qgspropertycollection.sip
%Include auto_generated/qgspropertytransformer.sip
Expand Down
23 changes: 21 additions & 2 deletions src/core/qgsprojutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,26 @@
#include <QThreadStorage>
#endif

#define SIP_NO_FILE
/**
* \class QgsProjUtils
* \ingroup core
* Utility functions for working with the proj library.
* \since QGIS 3.8
*/
class CORE_EXPORT QgsProjUtils
{
public:

/**
* Returns the proj library major version number.
*/
static int projVersionMajor()
{
return PROJ_VERSION_MAJOR;
}
};

#ifndef SIP_RUN

#if PROJ_VERSION_MAJOR>=6
struct projCtx_t;
Expand Down Expand Up @@ -68,5 +87,5 @@ class CORE_EXPORT QgsProjContext
#endif
};


#endif
#endif // QGSPROJUTILS_H

0 comments on commit 545e8bc

Please sign in to comment.