216 Q_PROPERTY(
bool isGeographic READ isGeographic )
217 Q_PROPERTY( QString authid READ authid )
218 Q_PROPERTY( QString description READ description )
276 operator QVariant()
const
278 return QVariant::fromValue( *
this );
287 static QList< long > validSrsIds();
349 Q_DECL_DEPRECATED
bool createFromId(
long id, CrsType type = PostgisCrsId )
SIP_DEPRECATED;
363 bool createFromOgcWmsCrs(
const QString &
crs );
374 Q_DECL_DEPRECATED
bool createFromSrid(
long srid )
SIP_DEPRECATED;
388 bool createFromWkt(
const QString &wkt );
402 bool createFromSrsId(
long srsId );
427 Q_DECL_DEPRECATED
bool createFromProj4(
const QString &projString )
SIP_DEPRECATED;
457 bool createFromProj(
const QString &projString,
bool identify =
true );
459 bool createFromProj(
const QString &projString );
477 bool createFromString(
const QString &definition );
496 bool createFromUserInput(
const QString &definition );
511 bool isValid() const;
558 bool readXml( const QDomNode &node );
566 bool writeXml( QDomNode &node, QDomDocument &doc ) const;
595 long postgisSrid() const;
609 QString authid() const;
618 QString description() const;
633 QString userFriendlyIdentifier(
Qgis::CrsIdentifierType type =
Qgis::CrsIdentifierType::MediumString ) const;
641 QString projectionAcronym() const;
649 QString ellipsoidAcronym() const;
662 QString toWkt(
Qgis::CrsWktVariant variant =
Qgis::CrsWktVariant::Wkt1Gdal,
bool multiline = false,
int indentationWidth = 4 ) const;
690 QString toProj() const;
697 Qgis::CrsType type() const;
704 bool isDeprecated() const;
710 bool isGeographic() const;
720 bool isDynamic() const;
772 void setCoordinateEpoch(
double epoch );
797 double coordinateEpoch() const;
835 QList< Qgis::CrsAxisDirection > axisOrdering()
const;
837 SIP_PYOBJECT axisOrdering() const
SIP_TYPEHINT( List[
Qgis.CrsAxisDirection] );
841 const QList<
Qgis::CrsAxisDirection > cppRes = sipCpp->axisOrdering();
843 PyObject *l = PyList_New( cppRes.size() );
849 for (
int i = 0; i < cppRes.size(); ++i )
851 PyObject *eobj = sipConvertFromEnum(
static_cast<int>( cppRes.at( i ) ),
852 sipType_Qgis_CrsAxisDirection );
859 PyList_SetItem( l, i, eobj );
896 QString toOgcUri()
const;
916 void updateDefinition();
921 void setValidationHint(
const QString &html );
926 QString validationHint()
const;
934 static int syncDatabase();
985 QString geographicCrsAuthId()
const;
988 SIP_PYOBJECT __repr__();
990 const QString
str = sipCpp->isValid() ? QStringLiteral(
"<QgsCoordinateReferenceSystem: %1%2>" ).arg( !sipCpp->authid().isEmpty() ? sipCpp->authid() : sipCpp->toWkt(
Qgis::CrsWktVariant::Preferred ),
991 std::isfinite( sipCpp->coordinateEpoch() ) ? QStringLiteral(
" @ %1" ).arg( sipCpp->coordinateEpoch() ) : QString() )
992 : QStringLiteral(
"<QgsCoordinateReferenceSystem: invalid>" );
993 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
1008 PJ *projObject()
const;
1030 bool createFromProjObject(
PJ *
object );
1039 Q_DECL_DEPRECATED
static QStringList recentProjections()
SIP_DEPRECATED;
1067 Q_DECL_DEPRECATED static
void clearRecentCoordinateReferenceSystems()
SIP_DEPRECATED;
1080 static void invalidateCache(
bool disableCache =
false );
1089 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
1102 static QString projFromSrsId(
int srsId );
1109 void setProjString(
const QString &projString );
1114 bool setWktString(
const QString &wkt );
1122 typedef QMap<QString, QString> RecordMap;
1131 RecordMap getRecord(
const QString &sql );
1143 static long getRecordCount();
1145 bool loadFromAuthCode(
const QString &auth,
const QString &code );
1150 static QList< long > userSrsIds();
1159 long matchToUserCrs()
const;
1165 bool loadFromDatabase(
const QString &db,
const QString &expression,
const QString &value );
1167 bool createFromWktInternal(
const QString &wkt,
const QString &description );
1169 QExplicitlySharedDataPointer<QgsCoordinateReferenceSystemPrivate> d;
1171 QString mValidationHint;
1178 static void removeFromCacheObjectsBelongingToCurrentThread(
PJ_CONTEXT *pj_context );
1185 static bool sDisableSrIdCache;
1186 static bool sDisableOgcCache;
1187 static bool sDisableProjCache;
1188 static bool sDisableWktCache;
1189 static bool sDisableSrsIdCache;
1190 static bool sDisableStringCache;
1193 static const QHash< QString, QgsCoordinateReferenceSystem > &stringCache();
1194 static const QHash< QString, QgsCoordinateReferenceSystem > &projCache();
1195 static const QHash< QString, QgsCoordinateReferenceSystem > &ogcCache();
1196 static const QHash< QString, QgsCoordinateReferenceSystem > &wktCache();
1197 static const QHash< long, QgsCoordinateReferenceSystem > &srsIdCache();
1198 static const QHash< long, QgsCoordinateReferenceSystem > &srIdCache();
1200 friend class TestQgsCoordinateReferenceSystem;
1207 bool createFromPostgisSrid(
const long id );
1216 QString mySummary( QStringLiteral(
"\n\tSpatial Reference System:" ) );
1217 mySummary += QLatin1String(
"\n\t\tDescription : " );
1224 mySummary += QLatin1String(
"Undefined" );
1226 mySummary += QLatin1String(
"\n\t\tProjection : " );
1233 mySummary += QLatin1String(
"Undefined" );
1236 mySummary += QLatin1String(
"\n\t\tEllipsoid : " );
1243 mySummary += QLatin1String(
"Undefined" );
1246 mySummary += QLatin1String(
"\n\t\tProjString : " );
1247 if ( !r.
toProj().isNull() )
1253 mySummary += QLatin1String(
"Undefined" );
1256 return os << mySummary.toLocal8Bit().data() << std::endl;
Used to create and store a proj context object, correctly freeing the context upon destruction.