Skip to content
Permalink
Browse files

Merge pull request #3331 from nyalldawson/crs

QgsCoordinateReferenceSystem - API fixes + internal caching
  • Loading branch information
nyalldawson committed Jul 25, 2016
2 parents 2b8b979 + 6dac8e1 commit bc2c2b201c3285ff5548d701f123711d5b8a7124
Showing with 795 additions and 768 deletions.
  1. +8 −0 doc/api_break.dox
  2. +58 −18 python/core/qgscoordinatereferencesystem.sip
  3. +0 −78 python/core/qgscrscache.sip
  4. +1 −2 src/app/gps/qgsgpsinformationwidget.cpp
  5. +1 −2 src/app/gps/qgsgpsmarker.cpp
  6. +1 −2 src/app/ogr/qgsvectorlayersaveasdialog.cpp
  7. +2 −3 src/app/openstreetmap/qgsosmdownloaddialog.cpp
  8. +5 −6 src/app/qgisapp.cpp
  9. +1 −2 src/app/qgsbookmarks.cpp
  10. +4 −2 src/app/qgscustomprojectiondialog.cpp
  11. +2 −3 src/app/qgsdecorationnortharrow.cpp
  12. +1 −1 src/app/qgsmeasuretool.cpp
  13. +2 −3 src/app/qgsnewspatialitelayerdialog.cpp
  14. +2 −3 src/app/qgsoptions.cpp
  15. +4 −5 src/app/qgsprojectproperties.cpp
  16. +1 −2 src/app/qgswelcomepageitemsmodel.cpp
  17. +1 −2 src/browser/qgsbrowser.cpp
  18. +1 −2 src/core/composer/qgscomposermap.cpp
  19. +5 −5 src/core/composer/qgscomposermapgrid.cpp
  20. +0 −1 src/core/qgsapplication.cpp
  21. +207 −18 src/core/qgscoordinatereferencesystem.cpp
  22. +81 −19 src/core/qgscoordinatereferencesystem.h
  23. +6 −1 src/core/qgscoordinatereferencesystem_p.h
  24. +7 −8 src/core/qgscoordinatetransform.cpp
  25. +2 −2 src/core/qgscoordinateutils.cpp
  26. +2 −162 src/core/qgscrscache.cpp
  27. +0 −89 src/core/qgscrscache.h
  28. +3 −4 src/core/qgsdistancearea.cpp
  29. +1 −1 src/core/qgsdistancearea.h
  30. +2 −3 src/core/qgsexpression.cpp
  31. +3 −4 src/core/qgsgml.cpp
  32. +3 −4 src/core/qgsmaprendererjob.cpp
  33. +1 −2 src/core/qgsmapsettings.cpp
  34. +4 −5 src/core/qgsogcutils.cpp
  35. +1 −1 src/core/qgsvectorlayer.cpp
  36. +2 −2 src/core/qgsvectorlayereditutils.cpp
  37. +1 −1 src/core/qgsvectorlayerrenderer.cpp
  38. +1 −1 src/gui/qgsadvanceddigitizingdockwidget.cpp
  39. +2 −3 src/gui/qgsmapcanvas.cpp
  40. +2 −3 src/gui/qgsnewgeopackagelayerdialog.cpp
  41. +1 −2 src/gui/qgsnewmemorylayerdialog.cpp
  42. +2 −3 src/gui/qgsnewvectorlayerdialog.cpp
  43. +3 −4 src/gui/qgsowssourceselect.cpp
  44. +6 −7 src/gui/qgsprojectionselectionwidget.cpp
  45. +2 −3 src/gui/qgssourceselectdialog.cpp
  46. +1 −2 src/plugins/georeferencer/qgstransformsettingsdialog.cpp
  47. +2 −2 src/plugins/globe/qgsglobetilesource.cpp
  48. +4 −5 src/plugins/grass/qgsgrassnewmapset.cpp
  49. +1 −2 src/providers/arcgisrest/qgsafsprovider.cpp
  50. +0 −1 src/providers/arcgisrest/qgsamsprovider.cpp
  51. +0 −1 src/providers/arcgisrest/qgsarcgisrestutils.cpp
  52. +1 −2 src/providers/db2/qgsdb2provider.cpp
  53. +3 −4 src/providers/gdal/qgsgdalprovider.cpp
  54. +2 −3 src/providers/grass/qgsgrass.cpp
  55. +5 −5 src/providers/grass/qgsgrassgislib.cpp
  56. +2 −3 src/providers/mssql/qgsmssqlprovider.cpp
  57. +2 −3 src/providers/ogr/qgsogrprovider.cpp
  58. +3 −3 src/providers/oracle/qgsoracleprovider.cpp
  59. +1 −2 src/providers/postgres/qgspostgresprovider.cpp
  60. +2 −3 src/providers/spatialite/qgsspatialiteprovider.cpp
  61. +1 −2 src/providers/virtual/qgsvirtuallayersourceselect.cpp
  62. +3 −4 src/providers/wcs/qgswcscapabilities.cpp
  63. +1 −2 src/providers/wcs/qgswcsdataitems.cpp
  64. +5 −6 src/providers/wcs/qgswcsprovider.cpp
  65. +3 −4 src/providers/wfs/qgswfscapabilities.cpp
  66. +3 −4 src/providers/wfs/qgswfsfeatureiterator.cpp
  67. +4 −5 src/providers/wfs/qgswfsprovider.cpp
  68. +2 −3 src/providers/wfs/qgswfssourceselect.cpp
  69. +10 −11 src/providers/wms/qgswmscapabilities.cpp
  70. +1 −2 src/providers/wms/qgswmsdataitems.cpp
  71. +7 −8 src/providers/wms/qgswmsprovider.cpp
  72. +3 −4 src/providers/wms/qgswmssourceselect.cpp
  73. +4 −5 src/server/qgsconfigparserutils.cpp
  74. +1 −2 src/server/qgshostedrdsbuilder.cpp
  75. +1 −2 src/server/qgshostedvdsbuilder.cpp
  76. +2 −2 src/server/qgsmaprenderer.cpp
  77. +4 −5 src/server/qgsserverprojectparser.cpp
  78. +2 −3 src/server/qgssldconfigparser.cpp
  79. +2 −3 src/server/qgswcsserver.cpp
  80. +0 −1 src/server/qgswfsserver.cpp
  81. +1 −1 src/server/qgswmsconfigparser.cpp
  82. +1 −1 src/server/qgswmsprojectparser.cpp
  83. +2 −3 src/server/qgswmsserver.cpp
  84. +258 −15 tests/src/core/testqgscoordinatereferencesystem.cpp
  85. +0 −1 tests/src/python/CMakeLists.txt
  86. +0 −2 tests/src/python/acceptable_missing_doc.py
  87. +0 −132 tests/src/python/test_qgscrscache.py
@@ -24,6 +24,9 @@ This page tries to maintain a list with incompatible changes that happened in pr
<li>QgsLabel and QgsLabelAttributes. Replaced by labeling based on PAL library, see QgsLabelingEngineV2.</li>
<li>QgsMapCanvasMap. It is an internal class used by map canvas.</li>
<li>QgsMapRenderer. It has been replaced by QgsMapRendererJob with subclasses and QgsMapSettings.</li>
<li>QgsCRSCache was removed. QgsCoordinateReferenceSystem now internally uses a cache for CRS creation,
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).</li>
</ul>

\subsection qgis_api_break_3_0_global General changes
@@ -103,9 +106,14 @@ qgsPermissiveToInt()</li>
\subsection qgis_api_break_3_0_QgsCoordinateReferenceSystem QgsCoordinateReferenceSystem

<ul>
<li>QgsCoordinateReferenceSystem now uses internal caches to avoid expensive database lookups
when CRS objects are initialized. This is handled internally, but invalidateCache() must be
called if changes are made to the CRS database.</li>
<li>setCustomSrsValidation() has been renamed to setCustomCrsValidation()</li>
<li>saveAsUserCRS() has been renamed to saveAsUserCrs()</li>
<li>geographicCRSAuthId() has been renamed to geographicCrsAuthId()</li>
<li>geographicFlag() was renamed to isGeographic()</li>
<li>axisInverted() was renamed to hasAxisInverted()</li>
</ul>

\subsection qgis_api_break_3_0_QgsCoordinateTransform QgsCoordinateTransform
@@ -119,19 +119,12 @@
* constructor that automatically recognizes definition format from the given string.
*
* Creation of CRS object involves some queries in a local SQLite database, which may
* be potentially expensive. It is therefore recommended to use QgsCRSCache methods
* that return possibly cached CRS objects instead of constructing new instances that
* involve the lookup overhead.
* be potentially expensive. Consequently, CRS creation methods use an internal cache to avoid
* unnecessary database lookups. If the CRS database is modified, then it is necessary to call
* invalidateCache() to ensure that outdated records are not being returned from the cache.
*
* Since QGIS 2.16 QgsCoordinateReferenceSystem objects are implicitly shared.
*
* The following table summarizes equivalents for non-cached and cached CRS lookup:
*
* Definition | Non-cached | Cached
* ----------- | --------------------- | ------------------------------
* Auth + Code | createFromOgcWmsCrs() | QgsCRSCache::crsByOgcWmsCrs()
* PROJ.4 | createFromProj4() | QgsCRSCache::crsByProj4()
* WKT | createFromWkt() | QgsCRSCache::crsByWkt()
*
* Caveats
* =======
@@ -140,7 +133,7 @@
* used by ESRI. They look very similar, but they are not the same. QGIS is able to consume
* both flavours.
*
* \see QgsCoordinateTransform, QgsCRSCache
* \see QgsCoordinateTransform
*/
class QgsCoordinateReferenceSystem
{
@@ -190,6 +183,47 @@ class QgsCoordinateReferenceSystem
// TODO QGIS 3: remove theType and always use EPSG code
QgsCoordinateReferenceSystem( const long theId, CrsType theType = PostgisCrsId );

// static creators

/** Creates a CRS from a given OGC WMS-format Coordinate Reference System string.
* @param ogcCrs OGR compliant CRS definition, eg "EPSG:4326"
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 3.0
* @see createFromOgcWmsCrs()
*/
static QgsCoordinateReferenceSystem fromOgcWmsCrs( const QString& ogcCrs );

/** Creates a CRS from a given EPSG ID.
* @param epsg epsg CRS ID
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 3.0
*/
static QgsCoordinateReferenceSystem fromEpsgId( long epsg );

/** Creates a CRS from a proj4 style formatted string.
* @param proj4 proj4 format string
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 3.0
* @see createFromProj4()
*/
static QgsCoordinateReferenceSystem fromProj4( const QString& proj4 );

/** Creates a CRS from a WKT spatial ref sys definition string.
* @param wkt WKT for the desired spatial reference system.
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 3.0
* @see createFromWkt()
*/
static QgsCoordinateReferenceSystem fromWkt( const QString& wkt );

/** Creates a CRS from a specified QGIS SRS ID.
* @param srsId internal QGIS SRS ID
* @returns matching CRS, or an invalid CRS if ID could not be found
* @note added in QGIS 3.0
* @see createFromSrsId()
*/
static QgsCoordinateReferenceSystem fromSrsId( long srsId );

// Misc helper functions -----------------------

/**
@@ -207,7 +241,7 @@ class QgsCoordinateReferenceSystem
* Accepts both "<auth>:<code>" format and OGC URN "urn:ogc:def:crs:<auth>:[<version>]:<code>".
* It also recognizes "QGIS", "USER", "CUSTOM" authorities, which all have the same meaning
* and refer to QGIS internal CRS IDs.
* @note this method is expensive. Consider using QgsCRSCache::crsByOgcWmsCrs() instead.
* @note this method uses an internal cache. Call invalidateCache() to clear the cache.
* @return True on success else false
*/
// TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
@@ -227,7 +261,7 @@ class QgsCoordinateReferenceSystem
* Otherwise the WKT will be converted to a proj4 string and createFromProj4()
* set up the object.
* @note Some members may be left blank if no match can be found in CRS database.
* @note this method is expensive. Consider using QgsCRSCache::crsByWkt() instead.
* @note this method uses an internal cache. Call invalidateCache() to clear the cache.
* @param theWkt The WKT for the desired spatial reference system.
* @return True on success else false
*/
@@ -237,7 +271,7 @@ class QgsCoordinateReferenceSystem
*
* If the srsid is < USER_CRS_START_ID, system CRS database is used, otherwise
* user's local CRS database from home directory is used.
* @note this method is expensive. Consider using QgsCRSCache::crsBySrsId() instead.
* @note this method uses an internal cache. Call invalidateCache() to clear the cache.
* @param theSrsId The internal QGIS CRS ID for the desired spatial reference system.
* @return True on success else false
*/
@@ -260,7 +294,7 @@ class QgsCoordinateReferenceSystem
* - if none of the above match, use findMatchingProj()
*
* @note Some members may be left blank if no match can be found in CRS database.
* @note this method is expensive. Consider using QgsCRSCache::crsByProj4() instead.
* @note this method uses an internal cache. Call invalidateCache() to clear the cache.
* @param theProjString A proj4 format string
* @return True on success else false
*/
@@ -436,13 +470,12 @@ class QgsCoordinateReferenceSystem
/** Returns whether the CRS is a geographic CRS (using lat/lon coordinates)
* @returns true if CRS is geographic, or false if it is a projected CRS
*/
//TODO QGIS 3.0 - rename to isGeographic
bool geographicFlag() const;
bool isGeographic() const;

/** Returns whether axis is inverted (eg. for WMS 1.3) for the CRS.
* @returns true if CRS axis is inverted
*/
bool axisInverted() const;
bool hasAxisInverted() const;

/** Returns the units for the projection used by the CRS.
*/
@@ -479,4 +512,11 @@ class QgsCoordinateReferenceSystem
* @note added in QGIS 2.7
*/
static QStringList recentProjections();

/** Clears the internal cache used to initialise QgsCoordinateReferenceSystem objects.
* This should be called whenever the srs database has been modified in order to ensure
* that outdated CRS objects are not created.
* @note added in QGIS 3.0
*/
static void invalidateCache();
};
@@ -25,81 +25,3 @@ class QgsCoordinateTransformCache
QgsCoordinateTransformCache( const QgsCoordinateTransformCache& rh );
};

/** \ingroup core
* \class QgsCrsCache
* \brief 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.
*/

class QgsCrsCache
{
%TypeHeaderCode
#include <qgscrscache.h>
%End

public:

//! Returns a pointer to the QgsCRSCache singleton
static QgsCrsCache* instance();

/** Returns the CRS for authid, e.g. 'EPSG:4326' (or an invalid CRS in case of error)
* @deprecated use crsByOgcWmsCrs() instead
*/
QgsCoordinateReferenceSystem crsByAuthId( const QString& authid ) /Deprecated/;

/** Returns the CRS from a given OGC WMS-format Coordinate Reference System string.
* @param ogcCrs OGR 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 QgsCoordinateReferenceSystem::createFromOgcWmsCrs()
*/
QgsCoordinateReferenceSystem crsByOgcWmsCrs( const QString& ogcCrs ) const;

/** Returns the CRS from a given EPSG ID.
* @param epsg epsg CRS ID
* @returns matching CRS, or an invalid CRS if string could not be matched
*/
QgsCoordinateReferenceSystem crsByEpsgId( long epsg ) const;

/** Returns the CRS from a proj4 style formatted string.
* @param proj4 proj4 format string
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 2.16
* @see QgsCoordinateReferenceSystem::createFromProj4()
*/
QgsCoordinateReferenceSystem crsByProj4( const QString& proj4 ) const;

/** Returns the CRS from a WKT spatial ref sys definition string.
* @param wkt WKT for the desired spatial reference system.
* @returns matching CRS, or an invalid CRS if string could not be matched
* @note added in QGIS 2.16
* @see QgsCoordinateReferenceSystem::createFromWkt()
*/
QgsCoordinateReferenceSystem crsByWkt( const QString& wkt ) const;

/** Returns the CRS from a specified QGIS SRS ID.
* @param srsId internal QGIS SRS ID
* @returns matching CRS, or an invalid CRS if ID could not be found
* @note added in QGIS 2.16
* @see QgsCoordinateReferenceSystem::createFromSrsId()
*/
QgsCoordinateReferenceSystem crsBySrsId( long srsId ) const;

/** Updates the cached definition of a CRS. Should be called if the definition of a user-created
* CRS has been changed.
* @param authid CRS auth ID, eg "EPSG:4326" or "USER:100009"
*/
void updateCrsCache( const QString& authid );

protected:
QgsCrsCache();

private:

QgsCrsCache( const QgsCrsCache& other );
};
@@ -35,7 +35,6 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgswkbptr.h"
#include "qgscrscache.h"

// QWT Charting widget

@@ -229,7 +228,7 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
radRecenterWhenNeeded->setChecked( true );
}

mWgs84CRS = QgsCrsCache::instance()->crsByOgcWmsCrs( "EPSG:4326" );
mWgs84CRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( "EPSG:4326" );

mBtnDebug->setVisible( mySettings.value( "/gps/showDebug", "false" ).toBool() ); // use a registry setting to control - power users/devs could set it

@@ -18,14 +18,13 @@
#include "qgsgpsmarker.h"
#include "qgscoordinatetransform.h"
#include "qgsmapcanvas.h"
#include "qgscrscache.h"
#include "qgscsexception.h"

QgsGpsMarker::QgsGpsMarker( QgsMapCanvas* mapCanvas )
: QgsMapCanvasItem( mapCanvas )
{
mSize = 16;
mWgs84CRS = QgsCrsCache::instance()->crsByOgcWmsCrs( "EPSG:4326" );
mWgs84CRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( "EPSG:4326" );
mSvg.load( QString( ":/images/north_arrows/gpsarrow2.svg" ) );
if ( ! mSvg.isValid() )
{
@@ -16,7 +16,6 @@
* *
***************************************************************************/
#include "qgslogger.h"
#include "qgscrscache.h"
#include "qgsvectorlayersaveasdialog.h"
#include "qgsgenericprojectionselector.h"
#include "qgsvectordataprovider.h"
@@ -102,7 +101,7 @@ void QgsVectorLayerSaveAsDialog::setup()
idx = 0;
}

QgsCoordinateReferenceSystem srs = QgsCrsCache::instance()->crsBySrsId( mCRS );
QgsCoordinateReferenceSystem srs = QgsCoordinateReferenceSystem::fromSrsId( mCRS );
mCrsSelector->setCrs( srs );
mCrsSelector->setLayerCrs( srs );
mCrsSelector->dialog()->setMessage( tr( "Select the coordinate reference system for the vector file. "
@@ -21,7 +21,6 @@

#include "qgis.h"
#include "qgisapp.h"
#include "qgscrscache.h"
#include "qgsmapcanvas.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
@@ -104,7 +103,7 @@ void QgsOSMDownloadDialog::onExtentCanvas()

if ( QgisApp::instance()->mapCanvas()->hasCrsTransformEnabled() )
{
QgsCoordinateReferenceSystem dst = QgsCrsCache::instance()->crsBySrsId( GEOCRS_ID );
QgsCoordinateReferenceSystem dst = QgsCoordinateReferenceSystem::fromSrsId( GEOCRS_ID );

QgsCoordinateTransform ct( QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs(), dst );
r = ct.transformBoundingBox( r );
@@ -143,7 +142,7 @@ void QgsOSMDownloadDialog::onCurrentLayerChanged( int index )
if ( !layer )
return;

QgsCoordinateReferenceSystem dst = QgsCrsCache::instance()->crsBySrsId( GEOCRS_ID );
QgsCoordinateReferenceSystem dst = QgsCoordinateReferenceSystem::fromSrsId( GEOCRS_ID );

QgsCoordinateTransform ct( layer->crs(), dst );
QgsRectangle rect( ct.transformBoundingBox( layer->extent() ) );
@@ -127,7 +127,6 @@
#include "qgscoordinatetransform.h"
#include "qgscoordinateutils.h"
#include "qgscredentialdialog.h"
#include "qgscrscache.h"
#include "qgscursors.h"
#include "qgscustomization.h"
#include "qgscustomlayerorderwidget.h"
@@ -513,7 +512,7 @@ void QgisApp::validateCrs( QgsCoordinateReferenceSystem &srs )
if ( authid.isNull() )
authid = QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().authid();

QgsCoordinateReferenceSystem defaultCrs = QgsCrsCache::instance()->crsByOgcWmsCrs( authid );
QgsCoordinateReferenceSystem defaultCrs = QgsCoordinateReferenceSystem::fromOgcWmsCrs( authid );
if ( defaultCrs.isValid() )
{
mySelector->setSelectedCrsId( defaultCrs.srsid() );
@@ -4413,7 +4412,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )

// set project CRS
QString defCrs = settings.value( "/Projections/projectDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
QgsCoordinateReferenceSystem srs = QgsCrsCache::instance()->crsByOgcWmsCrs( defCrs );
QgsCoordinateReferenceSystem srs = QgsCoordinateReferenceSystem::fromOgcWmsCrs( defCrs );
mMapCanvas->setDestinationCrs( srs );
// write the projections _proj string_ to project settings
prj->writeEntry( "SpatialRefSys", "/ProjectCRSProj4String", srs.toProj4() );
@@ -6171,7 +6170,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer* vlayer, bool symbologyOpt
QgsWKBTypes::Type forcedGeometryType = dialog->geometryType();

QgsCoordinateTransform ct;
destCRS = QgsCrsCache::instance()->crsBySrsId( dialog->crs() );
destCRS = QgsCoordinateReferenceSystem::fromSrsId( dialog->crs() );

if ( destCRS.isValid() && destCRS != vlayer->crs() )
{
@@ -8469,7 +8468,7 @@ void QgisApp::setLayerCrs()
return;
}

QgsCoordinateReferenceSystem crs = QgsCrsCache::instance()->crsBySrsId( mySelector.selectedCrsId() );
QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem::fromSrsId( mySelector.selectedCrsId() );

Q_FOREACH ( QgsLayerTreeNode* node, mLayerTreeView->selectedNodes() )
{
@@ -8626,7 +8625,7 @@ void QgisApp::legendGroupSetCrs()
return;
}

QgsCoordinateReferenceSystem crs = QgsCrsCache::instance()->crsBySrsId( mySelector.selectedCrsId() );
QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem::fromSrsId( mySelector.selectedCrsId() );
Q_FOREACH ( QgsLayerTreeLayer* nodeLayer, currentGroup->findLayers() )
{
if ( nodeLayer->layer() )
@@ -21,7 +21,6 @@
#include "qgsmapcanvas.h"
#include "qgsproject.h"
#include "qgsmessagelog.h"
#include "qgscrscache.h"

#include "qgslogger.h"

@@ -232,7 +231,7 @@ void QgsBookmarks::zoomToBookmark()
if ( srid > 0 &&
srid != QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().srsid() )
{
QgsCoordinateTransform ct( QgsCrsCache::instance()->crsBySrsId( srid ),
QgsCoordinateTransform ct( QgsCoordinateReferenceSystem::fromSrsId( srid ),
QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs() );
rect = ct.transform( rect );
if ( rect.isEmpty() )

0 comments on commit bc2c2b2

Please sign in to comment.
You can’t perform that action at this time.