QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Caches QgsCoordinateReferenceSystem construction, which may be expensive. More...
#include <qgscrscache.h>
Public Member Functions | |
Q_DECL_DEPRECATED QgsCoordinateReferenceSystem | crsByAuthId (const QString &authid) |
Returns the CRS for authid, e.g. More... | |
QgsCoordinateReferenceSystem | crsByEpsgId (long epsg) const |
Returns the CRS from a given EPSG ID. More... | |
QgsCoordinateReferenceSystem | crsByOgcWmsCrs (const QString &ogcCrs) const |
Returns the CRS from a given OGC WMS-format Coordinate Reference System string. More... | |
QgsCoordinateReferenceSystem | crsByProj4 (const QString &proj4) const |
Returns the CRS from a proj4 style formatted string. More... | |
QgsCoordinateReferenceSystem | crsBySrsId (long srsId) const |
Returns the CRS from a specified QGIS SRS ID. More... | |
QgsCoordinateReferenceSystem | crsByWkt (const QString &wkt) const |
Returns the CRS from a WKT spatial ref sys definition string. More... | |
void | updateCRSCache (const QString &authid) |
Updates the cached definition of a CRS. More... | |
Static Public Member Functions | |
static QgsCRSCache * | instance () |
Returns a pointer to the QgsCRSCache singleton. More... | |
Protected Member Functions | |
QgsCRSCache () | |
Caches QgsCoordinateReferenceSystem construction, which may be expensive.
QgsCRSCache maintains a cache of previously constructed coordinate systems, so that creating a new CRS from the cache can reuse previously calculated parameters. The constructors for QgsCoordinateReferenceSystem can be expensive, so it's recommended to use QgsCRSCache instead of directly calling the QgsCoordinateReferenceSystem constructors.
Definition at line 67 of file qgscrscache.h.
|
protected |
Definition at line 97 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsByAuthId | ( | const QString & | authid | ) |
Returns the CRS for authid, e.g.
'EPSG:4326' (or an invalid CRS in case of error)
Definition at line 120 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsByEpsgId | ( | long | epsg | ) | const |
Returns the CRS from a given EPSG ID.
epsg | epsg CRS ID |
Definition at line 155 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsByOgcWmsCrs | ( | const QString & | ogcCrs | ) | const |
Returns the CRS from a given OGC WMS-format Coordinate Reference System string.
ogcCrs | OGR compliant CRS definition, eg "EPSG:4326" |
Definition at line 125 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsByProj4 | ( | const QString & | proj4 | ) | const |
Returns the CRS from a proj4 style formatted string.
proj4 | proj4 format string |
Definition at line 160 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsBySrsId | ( | long | srsId | ) | const |
Returns the CRS from a specified QGIS SRS ID.
srsId | internal QGIS SRS ID |
Definition at line 220 of file qgscrscache.cpp.
QgsCoordinateReferenceSystem QgsCRSCache::crsByWkt | ( | const QString & | wkt | ) | const |
Returns the CRS from a WKT spatial ref sys definition string.
wkt | WKT for the desired spatial reference system. |
Definition at line 190 of file qgscrscache.cpp.
|
static |
Returns a pointer to the QgsCRSCache singleton.
Definition at line 91 of file qgscrscache.cpp.
void QgsCRSCache::updateCRSCache | ( | const QString & | authid | ) |
Updates the cached definition of a CRS.
Should be called if the definition of a user-created CRS has been changed.
authid | CRS auth ID, eg "EPSG:4326" or "USER:100009" |
Definition at line 104 of file qgscrscache.cpp.