Skip to content
Permalink
Browse files

consider datum transformation when pasting features

proper fix in master bae6d56 could not be cherry-picked easily, this is not a perfect solution but it does solve the issue
  • Loading branch information
3nids committed Jul 19, 2017
1 parent b036b0b commit 7b424e62f9f2102b0ebc4f7b6b8ee9e44065973c
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/app/qgsclipboard.cpp
@@ -35,6 +35,7 @@
#include "qgsvectorlayer.h"
#include "qgsogrutils.h"
#include "qgsjsonutils.h"
#include "qgsdatumtransformdialog.h"

QgsClipboard::QgsClipboard()
: QObject()
@@ -265,6 +266,28 @@ QgsFeatureList QgsClipboard::transformedCopyOf( const QgsCoordinateReferenceSyst
QgsFeatureList featureList = copyOf( fields );
QgsCoordinateTransform ct( crs(), destCRS );

//ask user about datum transformation
QSettings settings;
QList< QList< int > > dt = QgsCoordinateTransform::datumTransformations( crs(), destCRS );
if ( dt.size() > 1 && settings.value( "Projections/showDatumTransformDialog", false ).toBool() )
{
QgsDatumTransformDialog d( tr( "Datum transformation for copied features" ), dt );
if ( d.exec() == QDialog::Accepted )
{
QList< int > sdt = d.selectedDatumTransform();
if ( !sdt.isEmpty() )
{
ct.setSourceDatumTransform( sdt.at( 0 ) );
}
if ( sdt.size() > 1 )
{
ct.setDestinationDatumTransform( sdt.at( 1 ) );
}
ct.initialise();
}
}


QgsDebugMsg( "transforming clipboard." );
for ( QgsFeatureList::iterator iter = featureList.begin(); iter != featureList.end(); ++iter )
{

0 comments on commit 7b424e6

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