216 Q_PROPERTY(
bool isGeographic READ isGeographic )
217 Q_PROPERTY( QString authid READ authid )
218 Q_PROPERTY( QString description READ description )
273 operator QVariant()
const
275 return QVariant::fromValue( *
this );
284 static QList< long > validSrsIds();
363 Q_DECL_DEPRECATED
bool createFromId(
long id, CrsType type = PostgisCrsId )
SIP_DEPRECATED;
377 bool createFromOgcWmsCrs(
const QString &
crs );
388 Q_DECL_DEPRECATED
bool createFromSrid(
long srid )
SIP_DEPRECATED;
402 bool createFromWkt(
const QString &wkt );
416 bool createFromSrsId(
long srsId );
441 Q_DECL_DEPRECATED
bool createFromProj4(
const QString &projString )
SIP_DEPRECATED;
471 bool createFromProj(
const QString &projString,
bool identify =
true );
473 bool createFromProj(
const QString &projString );
491 bool createFromString(
const QString &definition );
510 bool createFromUserInput(
const QString &definition );
525 bool isValid() const;
562 bool readXml( const QDomNode &node );
570 bool writeXml( QDomNode &node, QDomDocument &doc ) const;
599 long postgisSrid() const;
613 QString authid() const;
622 QString description() const;
637 QString userFriendlyIdentifier(
Qgis::CrsIdentifierType type =
Qgis::CrsIdentifierType::MediumString ) const;
645 QString projectionAcronym() const;
653 QString ellipsoidAcronym() const;
666 QString toWkt(
Qgis::CrsWktVariant variant =
Qgis::CrsWktVariant::Wkt1Gdal,
bool multiline = false,
int indentationWidth = 4 ) const;
694 QString toProj() const;
701 Qgis::CrsType type() const;
708 bool isDeprecated() const;
714 bool isGeographic() const;
724 bool isDynamic() const;
776 void setCoordinateEpoch(
double epoch );
801 double coordinateEpoch() const;
839 QList< Qgis::CrsAxisDirection > axisOrdering()
const;
841 SIP_PYOBJECT axisOrdering() const
SIP_TYPEHINT( List[
Qgis.CrsAxisDirection] );
845 const QList<
Qgis::CrsAxisDirection > cppRes = sipCpp->axisOrdering();
847 PyObject *l = PyList_New( cppRes.size() );
853 for (
int i = 0; i < cppRes.size(); ++i )
855 PyObject *eobj = sipConvertFromEnum(
static_cast<int>( cppRes.at( i ) ),
856 sipType_Qgis_CrsAxisDirection );
863 PyList_SetItem( l, i, eobj );
900 QString toOgcUri()
const;
908 QString toOgcUrn()
const;
928 void updateDefinition();
933 void setValidationHint(
const QString &html );
938 QString validationHint()
const;
946 static int syncDatabase();
1028 bool hasVerticalAxis()
const;
1031 QString geographicCrsAuthId()
const;
1034 SIP_PYOBJECT __repr__();
1036 const QString
str = sipCpp->isValid() ? QStringLiteral(
"<QgsCoordinateReferenceSystem: %1%2>" ).arg( !sipCpp->authid().isEmpty() ? sipCpp->authid() : sipCpp->toWkt(
Qgis::CrsWktVariant::Preferred ),
1037 std::isfinite( sipCpp->coordinateEpoch() ) ? QStringLiteral(
" @ %1" ).arg( sipCpp->coordinateEpoch() ) : QString() )
1038 : QStringLiteral(
"<QgsCoordinateReferenceSystem: invalid>" );
1039 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
1054 PJ *projObject()
const;
1076 bool createFromProjObject(
PJ *
object );
1085 Q_DECL_DEPRECATED
static QStringList recentProjections()
SIP_DEPRECATED;
1113 Q_DECL_DEPRECATED static
void clearRecentCoordinateReferenceSystems()
SIP_DEPRECATED;
1126 static void invalidateCache(
bool disableCache =
false );
1135 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
1148 static QString projFromSrsId(
int srsId );
1155 void setProjString(
const QString &projString );
1160 bool setWktString(
const QString &wkt );
1168 typedef QMap<QString, QString> RecordMap;
1177 RecordMap getRecord(
const QString &sql );
1189 static long getRecordCount();
1191 bool loadFromAuthCode(
const QString &auth,
const QString &code );
1196 static QList< long > userSrsIds();
1205 long matchToUserCrs()
const;
1211 bool loadFromDatabase(
const QString &db,
const QString &expression,
const QString &value );
1213 bool createFromWktInternal(
const QString &wkt,
const QString &description );
1215 QExplicitlySharedDataPointer<QgsCoordinateReferenceSystemPrivate> d;
1217 QString mValidationHint;
1224 static void removeFromCacheObjectsBelongingToCurrentThread(
PJ_CONTEXT *pj_context );
1231 static bool sDisableSrIdCache;
1232 static bool sDisableOgcCache;
1233 static bool sDisableProjCache;
1234 static bool sDisableWktCache;
1235 static bool sDisableSrsIdCache;
1236 static bool sDisableStringCache;
1239 static const QHash< QString, QgsCoordinateReferenceSystem > &stringCache();
1240 static const QHash< QString, QgsCoordinateReferenceSystem > &projCache();
1241 static const QHash< QString, QgsCoordinateReferenceSystem > &ogcCache();
1242 static const QHash< QString, QgsCoordinateReferenceSystem > &wktCache();
1243 static const QHash< long, QgsCoordinateReferenceSystem > &srsIdCache();
1244 static const QHash< long, QgsCoordinateReferenceSystem > &srIdCache();
1246 friend class TestQgsCoordinateReferenceSystem;
1253 bool createFromPostgisSrid(
const long id );
1262 QString mySummary( QStringLiteral(
"\n\tSpatial Reference System:" ) );
1263 mySummary += QLatin1String(
"\n\t\tDescription : " );
1270 mySummary += QLatin1String(
"Undefined" );
1272 mySummary += QLatin1String(
"\n\t\tProjection : " );
1279 mySummary += QLatin1String(
"Undefined" );
1282 mySummary += QLatin1String(
"\n\t\tEllipsoid : " );
1289 mySummary += QLatin1String(
"Undefined" );
1292 mySummary += QLatin1String(
"\n\t\tProjString : " );
1293 if ( !r.
toProj().isNull() )
1299 mySummary += QLatin1String(
"Undefined" );
1302 return os << mySummary.toLocal8Bit().data() << std::endl;
Used to create and store a proj context object, correctly freeing the context upon destruction.