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();
366 Q_DECL_DEPRECATED
bool createFromId(
long id, CrsType type = PostgisCrsId )
SIP_DEPRECATED;
380 bool createFromOgcWmsCrs(
const QString &
crs );
391 Q_DECL_DEPRECATED
bool createFromSrid(
long srid )
SIP_DEPRECATED;
405 bool createFromWkt(
const QString &wkt );
419 bool createFromSrsId(
long srsId );
444 Q_DECL_DEPRECATED
bool createFromProj4(
const QString &projString )
SIP_DEPRECATED;
474 bool createFromProj(
const QString &projString,
bool identify =
true );
476 bool createFromProj(
const QString &projString );
494 bool createFromString(
const QString &definition );
513 bool createFromUserInput(
const QString &definition );
528 bool isValid() const;
575 bool readXml( const QDomNode &node );
583 bool writeXml( QDomNode &node, QDomDocument &doc ) const;
612 long postgisSrid() const;
626 QString authid() const;
635 QString description() const;
650 QString userFriendlyIdentifier(
Qgis::CrsIdentifierType type =
Qgis::CrsIdentifierType::MediumString ) const;
658 QString projectionAcronym() const;
666 QString ellipsoidAcronym() const;
679 QString toWkt(
Qgis::CrsWktVariant variant =
Qgis::CrsWktVariant::Wkt1Gdal,
bool multiline = false,
int indentationWidth = 4 ) const;
707 QString toProj() const;
714 Qgis::CrsType type() const;
721 bool isDeprecated() const;
727 bool isGeographic() const;
737 bool isDynamic() const;
789 void setCoordinateEpoch(
double epoch );
814 double coordinateEpoch() const;
852 QList< Qgis::CrsAxisDirection > axisOrdering()
const;
854 SIP_PYOBJECT axisOrdering() const
SIP_TYPEHINT( List[
Qgis.CrsAxisDirection] );
858 const QList<
Qgis::CrsAxisDirection > cppRes = sipCpp->axisOrdering();
860 PyObject *l = PyList_New( cppRes.size() );
866 for (
int i = 0; i < cppRes.size(); ++i )
868 PyObject *eobj = sipConvertFromEnum(
static_cast<int>( cppRes.at( i ) ),
869 sipType_Qgis_CrsAxisDirection );
876 PyList_SetItem( l, i, eobj );
913 QString toOgcUri()
const;
921 QString toOgcUrn()
const;
941 void updateDefinition();
946 void setValidationHint(
const QString &html );
951 QString validationHint()
const;
959 static int syncDatabase();
1041 bool hasVerticalAxis()
const;
1044 QString geographicCrsAuthId()
const;
1047 SIP_PYOBJECT __repr__();
1049 const QString
str = sipCpp->isValid() ? QStringLiteral(
"<QgsCoordinateReferenceSystem: %1%2>" ).arg( !sipCpp->authid().isEmpty() ? sipCpp->authid() : sipCpp->toWkt(
Qgis::CrsWktVariant::Preferred ),
1050 std::isfinite( sipCpp->coordinateEpoch() ) ? QStringLiteral(
" @ %1" ).arg( sipCpp->coordinateEpoch() ) : QString() )
1051 : QStringLiteral(
"<QgsCoordinateReferenceSystem: invalid>" );
1052 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
1067 PJ *projObject()
const;
1089 bool createFromProjObject(
PJ *
object );
1098 Q_DECL_DEPRECATED
static QStringList recentProjections()
SIP_DEPRECATED;
1126 Q_DECL_DEPRECATED static
void clearRecentCoordinateReferenceSystems()
SIP_DEPRECATED;
1139 static void invalidateCache(
bool disableCache =
false );
1148 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
1161 static QString projFromSrsId(
int srsId );
1168 void setProjString(
const QString &projString );
1173 bool setWktString(
const QString &wkt );
1181 typedef QMap<QString, QString> RecordMap;
1190 RecordMap getRecord(
const QString &sql );
1202 static long getRecordCount();
1204 bool loadFromAuthCode(
const QString &auth,
const QString &code );
1209 static QList< long > userSrsIds();
1218 long matchToUserCrs()
const;
1224 bool loadFromDatabase(
const QString &db,
const QString &expression,
const QString &value );
1226 bool createFromWktInternal(
const QString &wkt,
const QString &description );
1228 QExplicitlySharedDataPointer<QgsCoordinateReferenceSystemPrivate> d;
1230 QString mValidationHint;
1237 static void removeFromCacheObjectsBelongingToCurrentThread(
PJ_CONTEXT *pj_context );
1244 static bool sDisableSrIdCache;
1245 static bool sDisableOgcCache;
1246 static bool sDisableProjCache;
1247 static bool sDisableWktCache;
1248 static bool sDisableSrsIdCache;
1249 static bool sDisableStringCache;
1252 static const QHash< QString, QgsCoordinateReferenceSystem > &stringCache();
1253 static const QHash< QString, QgsCoordinateReferenceSystem > &projCache();
1254 static const QHash< QString, QgsCoordinateReferenceSystem > &ogcCache();
1255 static const QHash< QString, QgsCoordinateReferenceSystem > &wktCache();
1256 static const QHash< long, QgsCoordinateReferenceSystem > &srsIdCache();
1257 static const QHash< long, QgsCoordinateReferenceSystem > &srIdCache();
1259 friend class TestQgsCoordinateReferenceSystem;
1266 bool createFromPostgisSrid(
const long id );
1275 QString mySummary( QStringLiteral(
"\n\tSpatial Reference System:" ) );
1276 mySummary += QLatin1String(
"\n\t\tDescription : " );
1283 mySummary += QLatin1String(
"Undefined" );
1285 mySummary += QLatin1String(
"\n\t\tProjection : " );
1292 mySummary += QLatin1String(
"Undefined" );
1295 mySummary += QLatin1String(
"\n\t\tEllipsoid : " );
1302 mySummary += QLatin1String(
"Undefined" );
1305 mySummary += QLatin1String(
"\n\t\tProjString : " );
1306 if ( !r.
toProj().isNull() )
1312 mySummary += QLatin1String(
"Undefined" );
1315 return os << mySummary.toLocal8Bit().data() << std::endl;
Used to create and store a proj context object, correctly freeing the context upon destruction.