QGIS API Documentation  2.15.0-Master (972fc9f)
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsCRSCache Class Reference

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...
 
void updateCRSCache (const QString &authid)
 Updates the cached definition of a CRS. More...
 

Static Public Member Functions

static QgsCRSCacheinstance ()
 Returns a pointer to the QgsCRSCache singleton. More...
 

Protected Member Functions

 QgsCRSCache ()
 

Detailed Description

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 65 of file qgscrscache.h.

Constructor & Destructor Documentation

QgsCRSCache::QgsCRSCache ( )
protected

Definition at line 97 of file qgscrscache.cpp.

Member Function Documentation

QgsCoordinateReferenceSystem QgsCRSCache::crsByAuthId ( const QString authid)

Returns the CRS for authid, e.g.

'EPSG:4326' (or an invalid CRS in case of error)

Deprecated:
use crsByOgcWmsCrs() instead

Definition at line 116 of file qgscrscache.cpp.

QgsCoordinateReferenceSystem QgsCRSCache::crsByEpsgId ( long  epsg) const

Returns the CRS from a given EPSG ID.

Parameters
epsgepsg CRS ID
Returns
matching CRS, or an invalid CRS if string could not be matched

Definition at line 139 of file qgscrscache.cpp.

QgsCoordinateReferenceSystem QgsCRSCache::crsByOgcWmsCrs ( const QString ogcCrs) const

Returns the CRS from a given OGC WMS-format Coordinate Reference System string.

Parameters
ogcCrsOGR compliant CRS definition, eg "EPSG:4326"
Returns
matching CRS, or an invalid CRS if string could not be matched
Note
added in QGIS 2.16
See also
QgsCoordinateReferenceSystem::createFromOgcWmsCrs()

Definition at line 121 of file qgscrscache.cpp.

QgsCoordinateReferenceSystem QgsCRSCache::crsByProj4 ( const QString proj4) const

Returns the CRS from a proj4 style formatted string.

Parameters
proj4proj4 format string
Returns
matching CRS, or an invalid CRS if string could not be matched
Note
added in QGIS 2.16
See also
QgsCoordinateReferenceSystem::createFromProj4()

Definition at line 144 of file qgscrscache.cpp.

QgsCRSCache * QgsCRSCache::instance ( )
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.

Parameters
authidCRS auth ID, eg "EPSG:4326" or "USER:100009"

Definition at line 101 of file qgscrscache.cpp.


The documentation for this class was generated from the following files: