Skip to content

Commit

Permalink
[bugfix] Bookmarks fix zoom to with coordinate transform
Browse files Browse the repository at this point in the history
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 8ecae4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -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() )
Expand Down

0 comments on commit 8ecae4f

Please sign in to comment.