Skip to content
Permalink
Browse files

Bugfix datum transformation

  • Loading branch information
mhugent committed Nov 8, 2013
1 parent 64440cf commit 6aa4d953024ae1d92f91ab915d9bf745c74fbe74
Showing with 12 additions and 5 deletions.
  1. +6 −2 src/gui/qgsdatumtransformdialog.cpp
  2. +6 −3 src/gui/qgsmapcanvas.cpp
@@ -9,13 +9,17 @@ QgsDatumTransformDialog::QgsDatumTransformDialog( const QString& layerName, cons
for ( ; it != dt.constEnd(); ++it )
{
QTreeWidgetItem* item = new QTreeWidgetItem();
QString itemText;
for ( int i = 0; i < 2; ++i )
{
if ( i >= it->size() )
{
break;
}

int nr = it->at( i );
item->setData( i, Qt::UserRole, nr );
if ( nr != -1 )
{
item->setData( i, Qt::UserRole, nr );
item->setText( i, QgsCoordinateTransform::datumTransformString( nr ) );
}
}
@@ -1555,15 +1555,14 @@ void QgsMapCanvas::getDatumTransformInfo( const QgsMapLayer* ml, const QString&
return;
}

//create two crs
const QgsCoordinateReferenceSystem& srcCRS = QgsCRSCache::instance()->crsByAuthId( srcAuthId );
const QgsCoordinateReferenceSystem& destCRS = QgsCRSCache::instance()->crsByAuthId( destAuthId );

//get list of datum transforms (QgsCoordinateTransform::datumTransformations
//get list of datum transforms
QList< QList< int > > dt = QgsCoordinateTransform::datumTransformations( srcCRS, destCRS );
if ( dt.size() < 2 )
{
return; //skip?
return;
}

//if several possibilities: present dialog
@@ -1577,6 +1576,10 @@ void QgsMapCanvas::getDatumTransformInfo( const QgsMapLayer* ml, const QString&
{
srcTransform = t.at( 0 );
}
if ( t.size() > 1 )
{
destTransform = t.at( 1 );
}
mMapRenderer->addLayerCoordinateTransform( ml->id(), srcAuthId, destAuthId, srcTransform, destTransform );
}
else

0 comments on commit 6aa4d95

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