Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add QgsCoordinateReferenceSystem::operation() for retrieving details
of the associated proj operation for a CRS Allows callers to determine the projection used for CRS objects and their details. Also add QgsCoordinateReferenceSystemRegistry::projOperations() for retrieving a complete list of all available PROJ operations
- Loading branch information
1 parent
7edc0f6
commit b6f60f6
Showing
12 changed files
with
274 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/proj/qgsprojoperation.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsProjOperation | ||
{ | ||
%Docstring(signature="appended") | ||
Contains information about a PROJ operation. | ||
|
||
.. versionadded:: 3.20 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsprojoperation.h" | ||
%End | ||
public: | ||
|
||
bool isValid() const; | ||
%Docstring | ||
Returns ``True`` if the body is a valid object, or ``False`` if it is a null/invalid | ||
object. | ||
%End | ||
|
||
QString id() const; | ||
%Docstring | ||
ID of operation. | ||
%End | ||
|
||
QString description() const; | ||
%Docstring | ||
Description. | ||
%End | ||
|
||
QString details() const; | ||
%Docstring | ||
Additional details. | ||
%End | ||
|
||
SIP_PYOBJECT __repr__(); | ||
%MethodCode | ||
QString str; | ||
if ( !sipCpp->isValid() ) | ||
{ | ||
str = QStringLiteral( "<QgsProjOperation: invalid>" ); | ||
} | ||
else | ||
{ | ||
str = QStringLiteral( "<QgsProjOperation: %1>" ).arg( sipCpp->id() ); | ||
} | ||
sipRes = PyUnicode_FromString( str.toUtf8().constData() ); | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/proj/qgsprojoperation.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/*************************************************************************** | ||
qgsprojoperation.h | ||
------------------------ | ||
begin : May 2021 | ||
copyright : (C) 2021 Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#ifndef QGSPROJOPERATION_H | ||
#define QGSPROJOPERATION_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgis_sip.h" | ||
#include <QString> | ||
|
||
/** | ||
* \ingroup core | ||
* \brief Contains information about a PROJ operation. | ||
* | ||
* \since QGIS 3.20 | ||
*/ | ||
class CORE_EXPORT QgsProjOperation | ||
{ | ||
public: | ||
|
||
/** | ||
* Returns TRUE if the body is a valid object, or FALSE if it is a null/invalid | ||
* object. | ||
*/ | ||
bool isValid() const { return mValid; } | ||
|
||
/** | ||
* ID of operation. | ||
*/ | ||
QString id() const { return mId; } | ||
|
||
/** | ||
* Description. | ||
*/ | ||
QString description() const { return mDescription; } | ||
|
||
/** | ||
* Additional details. | ||
*/ | ||
QString details() const { return mDetails; } | ||
|
||
#ifdef SIP_RUN | ||
SIP_PYOBJECT __repr__(); | ||
% MethodCode | ||
QString str; | ||
if ( !sipCpp->isValid() ) | ||
{ | ||
str = QStringLiteral( "<QgsProjOperation: invalid>" ); | ||
} | ||
else | ||
{ | ||
str = QStringLiteral( "<QgsProjOperation: %1>" ).arg( sipCpp->id() ); | ||
} | ||
sipRes = PyUnicode_FromString( str.toUtf8().constData() ); | ||
% End | ||
#endif | ||
|
||
private: | ||
|
||
bool mValid = false; | ||
QString mId; | ||
QString mDescription; | ||
QString mDetails; | ||
|
||
friend class QgsCoordinateReferenceSystemRegistry; | ||
friend class QgsCoordinateReferenceSystem; | ||
}; | ||
|
||
#endif // QGSCELESTIALBODY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.