216 Q_PROPERTY(
bool isGeographic READ isGeographic )
217 Q_PROPERTY( QString authid READ authid )
218 Q_PROPERTY( QString description READ description )
277 operator QVariant()
const
279 return QVariant::fromValue( *
this );
288 static QList< long > validSrsIds();
387 Q_DECL_DEPRECATED
bool createFromId(
long id, CrsType type = PostgisCrsId )
SIP_DEPRECATED;
404 bool createFromOgcWmsCrs(
const QString &
crs );
415 Q_DECL_DEPRECATED
bool createFromSrid(
long srid )
SIP_DEPRECATED;
432 bool createFromWkt(
const QString &wkt );
449 bool createFromSrsId(
long srsId );
477 Q_DECL_DEPRECATED
bool createFromProj4(
const QString &projString )
SIP_DEPRECATED;
509 bool createFromProj(
const QString &projString,
bool identify =
true );
511 bool createFromProj(
const QString &projString );
533 bool createFromString(
const QString &definition );
555 bool createFromUserInput(
const QString &definition );
570 bool isValid() const;
607 bool readXml( const QDomNode &node );
615 bool writeXml( QDomNode &node, QDomDocument &doc ) const;
644 long postgisSrid() const;
658 QString authid() const;
667 QString description() const;
682 QString userFriendlyIdentifier(
Qgis::CrsIdentifierType type =
Qgis::CrsIdentifierType::MediumString ) const;
690 QString projectionAcronym() const;
698 QString ellipsoidAcronym() const;
711 QString toWkt(
Qgis::CrsWktVariant variant =
Qgis::CrsWktVariant::Wkt1Gdal,
bool multiline = false,
int indentationWidth = 4 ) const;
739 QString toProj() const;
746 Qgis::CrsType type() const;
753 bool isDeprecated() const;
759 bool isGeographic() const;
769 bool isDynamic() const;
821 void setCoordinateEpoch(
double epoch );
846 double coordinateEpoch() const;
884 QList< Qgis::CrsAxisDirection > axisOrdering()
const;
886 SIP_PYOBJECT axisOrdering() const
SIP_TYPEHINT( List[
Qgis.CrsAxisDirection] );
890 const QList<
Qgis::CrsAxisDirection > cppRes = sipCpp->axisOrdering();
892 PyObject *l = PyList_New( cppRes.size() );
898 for (
int i = 0; i < cppRes.size(); ++i )
900 PyObject *eobj = sipConvertFromEnum(
static_cast<int>( cppRes.at( i ) ),
901 sipType_Qgis_CrsAxisDirection );
908 PyList_SetItem( l, i, eobj );
945 QString toOgcUri()
const;
953 QString toOgcUrn()
const;
973 void updateDefinition();
978 void setValidationHint(
const QString &html );
983 QString validationHint()
const;
991 static int syncDatabase();
1073 bool hasVerticalAxis()
const;
1076 QString geographicCrsAuthId()
const;
1079 SIP_PYOBJECT __repr__();
1081 const QString
str = sipCpp->isValid() ? QStringLiteral(
"<QgsCoordinateReferenceSystem: %1%2>" ).arg( !sipCpp->authid().isEmpty() ? sipCpp->authid() : sipCpp->toWkt(
Qgis::CrsWktVariant::Preferred ),
1082 std::isfinite( sipCpp->coordinateEpoch() ) ? QStringLiteral(
" @ %1" ).arg( sipCpp->coordinateEpoch() ) : QString() )
1083 : QStringLiteral(
"<QgsCoordinateReferenceSystem: invalid>" );
1084 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
1099 PJ *projObject()
const;
1121 bool createFromProjObject(
PJ *
object );
1130 Q_DECL_DEPRECATED
static QStringList recentProjections()
SIP_DEPRECATED;
1158 Q_DECL_DEPRECATED static
void clearRecentCoordinateReferenceSystems()
SIP_DEPRECATED;
1171 static void invalidateCache(
bool disableCache =
false );
1180 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
1193 static QString projFromSrsId(
int srsId );
1200 void setProjString(
const QString &projString );
1205 bool setWktString(
const QString &wkt );
1213 typedef QMap<QString, QString> RecordMap;
1222 RecordMap getRecord(
const QString &sql );
1234 static long getRecordCount();
1241 bool loadFromAuthCode(
const QString &auth,
const QString &code );
1246 static QList< long > userSrsIds();
1255 long matchToUserCrs()
const;
1261 bool loadFromDatabase(
const QString &db,
const QString &expression,
const QString &value );
1263 bool createFromWktInternal(
const QString &wkt,
const QString &description );
1265 QExplicitlySharedDataPointer<QgsCoordinateReferenceSystemPrivate> d;
1267 QString mValidationHint;
1274 static void removeFromCacheObjectsBelongingToCurrentThread(
PJ_CONTEXT *pj_context );
1281 static bool sDisableSrIdCache;
1282 static bool sDisableOgcCache;
1283 static bool sDisableProjCache;
1284 static bool sDisableWktCache;
1285 static bool sDisableSrsIdCache;
1286 static bool sDisableStringCache;
1289 static const QHash< QString, QgsCoordinateReferenceSystem > &stringCache();
1290 static const QHash< QString, QgsCoordinateReferenceSystem > &projCache();
1291 static const QHash< QString, QgsCoordinateReferenceSystem > &ogcCache();
1292 static const QHash< QString, QgsCoordinateReferenceSystem > &wktCache();
1293 static const QHash< long, QgsCoordinateReferenceSystem > &srsIdCache();
1294 static const QHash< long, QgsCoordinateReferenceSystem > &srIdCache();
1296 friend class TestQgsCoordinateReferenceSystem;
1303 bool createFromPostgisSrid(
const long id );
1312 QString mySummary( QStringLiteral(
"\n\tSpatial Reference System:" ) );
1313 mySummary += QLatin1String(
"\n\t\tDescription : " );
1320 mySummary += QLatin1String(
"Undefined" );
1322 mySummary += QLatin1String(
"\n\t\tProjection : " );
1329 mySummary += QLatin1String(
"Undefined" );
1332 mySummary += QLatin1String(
"\n\t\tEllipsoid : " );
1339 mySummary += QLatin1String(
"Undefined" );
1342 mySummary += QLatin1String(
"\n\t\tProjString : " );
1343 if ( !r.
toProj().isNull() )
1349 mySummary += QLatin1String(
"Undefined" );
1352 return os << mySummary.toLocal8Bit().data() << std::endl;
Used to create and store a proj context object, correctly freeing the context upon destruction.