From 8ecae4f51c0896a3d22906b82e8bb05a2c584647 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Wed, 6 Dec 2017 08:50:35 +0100 Subject: [PATCH] [bugfix] Bookmarks fix zoom to with coordinate transform Forward port of an unreported bug introduced by me when I changed the display value to EPSG:xxxx --- src/app/qgsbookmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/qgsbookmarks.cpp b/src/app/qgsbookmarks.cpp index e2a7e94178d..0cba264fe6d 100644 --- a/src/app/qgsbookmarks.cpp +++ b/src/app/qgsbookmarks.cpp @@ -234,15 +234,15 @@ void QgsBookmarks::zoomToBookmark() double ymin = index.sibling( index.row(), 4 ).data().toDouble(); double xmax = index.sibling( index.row(), 5 ).data().toDouble(); double ymax = index.sibling( index.row(), 6 ).data().toDouble(); - int srid = index.sibling( index.row(), 7 ).data().toInt(); + QString authid = index.sibling( index.row(), 7 ).data().toString(); QgsRectangle rect = QgsRectangle( xmin, ymin, xmax, ymax ); // backwards compatibility, older version had -1 in the srid column - if ( srid > 0 && - srid != QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().srsid() ) + if ( ! authid.isEmpty( ) && + authid != QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().authid() ) { - QgsCoordinateTransform ct( QgsCoordinateReferenceSystem::fromSrsId( srid ), + QgsCoordinateTransform ct( QgsCoordinateReferenceSystem::fromOgcWmsCrs( authid ), QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs() ); rect = ct.transform( rect ); if ( rect.isEmpty() )