Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
with
23 additions
and
0 deletions.
-
+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 ) |
|
|
{ |
|
|