Skip to content
Permalink
Browse files

[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
  • Loading branch information
elpaso committed Dec 6, 2017
1 parent aa68a9f commit 8ecae4f51c0896a3d22906b82e8bb05a2c584647
Showing with 4 additions and 4 deletions.
  1. +4 −4 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() )

0 comments on commit 8ecae4f

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