File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 35
35
#include " qgsvectorlayer.h"
36
36
#include " qgsogrutils.h"
37
37
#include " qgsjsonutils.h"
38
+ #include " qgsdatumtransformdialog.h"
38
39
39
40
QgsClipboard::QgsClipboard ()
40
41
: QObject()
@@ -265,6 +266,28 @@ QgsFeatureList QgsClipboard::transformedCopyOf( const QgsCoordinateReferenceSyst
265
266
QgsFeatureList featureList = copyOf ( fields );
266
267
QgsCoordinateTransform ct ( crs (), destCRS );
267
268
269
+ // ask user about datum transformation
270
+ QSettings settings;
271
+ QList< QList< int > > dt = QgsCoordinateTransform::datumTransformations ( crs (), destCRS );
272
+ if ( dt.size () > 1 && settings.value ( " Projections/showDatumTransformDialog" , false ).toBool () )
273
+ {
274
+ QgsDatumTransformDialog d ( tr ( " Datum transformation for copied features" ), dt );
275
+ if ( d.exec () == QDialog::Accepted )
276
+ {
277
+ QList< int > sdt = d.selectedDatumTransform ();
278
+ if ( !sdt.isEmpty () )
279
+ {
280
+ ct.setSourceDatumTransform ( sdt.at ( 0 ) );
281
+ }
282
+ if ( sdt.size () > 1 )
283
+ {
284
+ ct.setDestinationDatumTransform ( sdt.at ( 1 ) );
285
+ }
286
+ ct.initialise ();
287
+ }
288
+ }
289
+
290
+
268
291
QgsDebugMsg ( " transforming clipboard." );
269
292
for ( QgsFeatureList::iterator iter = featureList.begin (); iter != featureList.end (); ++iter )
270
293
{
You can’t perform that action at this time.
0 commit comments