diff --git a/src/app/georeferencer/qgsgeorefmainwindow.cpp b/src/app/georeferencer/qgsgeorefmainwindow.cpp index d43fa5b8c798..a91d593c8ef9 100644 --- a/src/app/georeferencer/qgsgeorefmainwindow.cpp +++ b/src/app/georeferencer/qgsgeorefmainwindow.cpp @@ -87,6 +87,11 @@ QgsGeoreferencerMainWindow::QgsGeoreferencerMainWindow( QWidget *parent, Qt::Win centralWidget->setLayout( mCentralLayout ); mCentralLayout->setContentsMargins( 0, 0, 0, 0 ); + QgsSettings settings; + // default to last used target CRS + QString targetCRSString = settings.value( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ) ).toString(); + mTargetCrs = QgsCoordinateReferenceSystem( targetCRSString ); + createActions(); createActionGroups(); createMenus(); @@ -108,7 +113,6 @@ QgsGeoreferencerMainWindow::QgsGeoreferencerMainWindow( QWidget *parent, Qt::Win mCanvas->clearExtentHistory(); // reset zoomnext/zoomlast - QgsSettings settings; if ( settings.value( QStringLiteral( "/Plugin-GeoReferencer/Config/ShowDocked" ) ).toBool() ) { dockThisWindow( true ); @@ -151,7 +155,6 @@ QgsGeoreferencerMainWindow::~QgsGeoreferencerMainWindow() delete mToolMovePointQgis; } -// ----------------------------- protected --------------------------------- // void QgsGeoreferencerMainWindow::closeEvent( QCloseEvent *e ) { switch ( checkNeedGCPSave() ) @@ -196,11 +199,8 @@ void QgsGeoreferencerMainWindow::reset() } } -// -------------------------- private slots -------------------------------- // -// File slots void QgsGeoreferencerMainWindow::openRaster( const QString &fileName ) { - // clearLog(); switch ( checkNeedGCPSave() ) { case QgsGeoreferencerMainWindow::GCPSAVE: @@ -254,8 +254,6 @@ void QgsGeoreferencerMainWindow::openRaster( const QString &fileName ) statusBar()->showMessage( tr( "Raster loaded: %1" ).arg( mRasterFileName ) ); setWindowTitle( tr( "Georeferencer - %1" ).arg( fileInfo.fileName() ) ); - // showMessageInLog(tr("Input raster"), mRasterFileName); - //delete old points clearGCPData(); @@ -285,7 +283,7 @@ void QgsGeoreferencerMainWindow::openRaster( const QString &fileName ) mActionLinkQGisToGeoref->setChecked( false ); } - mCanvas->clearExtentHistory(); // reset zoomnext/zoomlast + mCanvas->clearExtentHistory(); mWorldFileName = guessWorldFileName( mRasterFileName ); } @@ -347,14 +345,6 @@ void QgsGeoreferencerMainWindow::doGeoreference() { QgisApp::instance()->addRasterLayer( mModifiedRasterFileName, QFileInfo( mModifiedRasterFileName ).completeBaseName(), QString() ); } - - // showMessageInLog(tr("Modified raster saved in"), mModifiedRasterFileName); - // saveGCPs(); - - // mTransformParam = QgsGeorefTransform::InvalidTransform; - // mGeorefTransform.selectTransformParametrisation(mTransformParam); - // mGCPListWidget->setGeorefTransform(&mGeorefTransform); - // mTransformParamLabel->setText(tr("Transform: ") + convertTransformEnumToString(mTransformParam)); } } } @@ -362,23 +352,21 @@ void QgsGeoreferencerMainWindow::doGeoreference() bool QgsGeoreferencerMainWindow::getTransformSettings() { QgsTransformSettingsDialog d( mRasterFileName, mModifiedRasterFileName ); + d.setTargetCrs( mTargetCrs ); if ( !d.exec() ) { return false; } d.getTransformSettings( mTransformParam, mResamplingMethod, mCompressionMethod, - mModifiedRasterFileName, mProjection, mPdfOutputMapFile, mPdfOutputFile, mSaveGcp, mUseZeroForTrans, mLoadInQgis, mUserResX, mUserResY ); + mModifiedRasterFileName, mPdfOutputMapFile, mPdfOutputFile, mSaveGcp, mUseZeroForTrans, mLoadInQgis, mUserResX, mUserResY ); + mTargetCrs = d.targetCrs(); + mTransformParamLabel->setText( tr( "Transform: " ) + QgsGcpTransformerInterface::methodToString( mTransformParam ) ); mGeorefTransform.selectTransformParametrisation( mTransformParam ); mGCPListWidget->setGeorefTransform( &mGeorefTransform ); mWorldFileName = guessWorldFileName( mRasterFileName ); - // showMessageInLog(tr("Output raster"), mModifiedRasterFileName.isEmpty() ? tr("Non set") : mModifiedRasterFileName); - // showMessageInLog(tr("Target projection"), mProjection.isEmpty() ? tr("Non set") : mProjection); - // logTransformOptions(); - // logRequaredGCPs(); - const bool hasReferencing = QgsGcpTransformerInterface::TransformMethod::InvalidTransform != mTransformParam || mLayer->crs().isValid(); mActionLinkGeorefToQgis->setEnabled( hasReferencing ); @@ -389,6 +377,13 @@ bool QgsGeoreferencerMainWindow::getTransformSettings() mActionLinkQGisToGeoref->setChecked( false ); } + //update gcp model + if ( mGCPListWidget ) + { + mGCPListWidget->setTargetCrs( mTargetCrs, QgsProject::instance()->transformContext() ); + mGCPListWidget->updateResiduals(); + } + updateTransformParamLabel(); return true; } @@ -429,7 +424,6 @@ void QgsGeoreferencerMainWindow::generateGDALScript() } } -// Edit slots void QgsGeoreferencerMainWindow::setAddPointTool() { mCanvas->setMapTool( mToolAddPoint ); @@ -456,7 +450,6 @@ void QgsGeoreferencerMainWindow::setMovePointTool() QgisApp::instance()->mapCanvas()->setMapTool( mToolMovePointQgis ); } -// View slots void QgsGeoreferencerMainWindow::setPanTool() { mCanvas->setMapTool( mToolPan ); @@ -509,7 +502,6 @@ void QgsGeoreferencerMainWindow::linkGeorefToQgis( bool link ) } } -// GCPs slots void QgsGeoreferencerMainWindow::addPoint( const QgsPointXY &sourceCoords, const QgsPointXY &destinationMapCoords, const QgsCoordinateReferenceSystem &destinationCrs, bool enable, bool finalize ) { @@ -615,7 +607,7 @@ void QgsGeoreferencerMainWindow::showCoordDialog( const QgsPointXY &sourceCoordi mNewlyAddedPointItem->setPointColor( QColor( 0, 200, 0 ) ); mNewlyAddedPointItem->setPos( mNewlyAddedPointItem->toCanvasCoordinates( sourceCoordinates ) ); - QgsCoordinateReferenceSystem lastProjection = mLastGCPProjection.isValid() ? mLastGCPProjection : mProjection; + QgsCoordinateReferenceSystem lastProjection = mLastGCPProjection.isValid() ? mLastGCPProjection : mTargetCrs; if ( mLayer && !mMapCoordsDialog ) { mMapCoordsDialog = new QgsMapCoordsDialog( QgisApp::instance()->mapCanvas(), sourceCoordinates, lastProjection, this ); @@ -673,7 +665,6 @@ void QgsGeoreferencerMainWindow::saveGCPsDialog() saveGCPs(); } -// Settings slots void QgsGeoreferencerMainWindow::showRasterPropertiesDialog() { if ( mLayer ) @@ -707,8 +698,6 @@ void QgsGeoreferencerMainWindow::showGeorefConfigDialog() //update gcp model if ( mGCPListWidget ) { - const QgsCoordinateReferenceSystem targetCrs( QgsSettings().value( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ) ).toString() ); - mGCPListWidget->setTargetCrs( targetCrs, QgsProject::instance()->transformContext() ); mGCPListWidget->updateResiduals(); } //and status bar @@ -716,7 +705,6 @@ void QgsGeoreferencerMainWindow::showGeorefConfigDialog() } } -// Histogram stretch slots void QgsGeoreferencerMainWindow::fullHistogramStretch() { mLayer->setContrastEnhancement( QgsContrastEnhancement::StretchToMinimumMaximum ); @@ -737,7 +725,6 @@ void QgsGeoreferencerMainWindow::recenterOnPoint( const QgsPointXY &point ) mCanvas->refresh(); } -// This slot is called whenever the georeference canvas changes the displayed extent void QgsGeoreferencerMainWindow::extentsChangedGeorefCanvas() { // Guard against endless recursion by ping-pong updates @@ -766,7 +753,6 @@ void QgsGeoreferencerMainWindow::extentsChangedGeorefCanvas() } } -// This slot is called whenever the qgis main canvas changes the displayed extent void QgsGeoreferencerMainWindow::extentsChangedQGisCanvas() { // Guard against endless recursion by ping-pong updates @@ -803,7 +789,6 @@ void QgsGeoreferencerMainWindow::updateCanvasRotation() mCanvas->refresh(); } -// Canvas info slots (copy/pasted from QGIS :) ) void QgsGeoreferencerMainWindow::showMouseCoords( const QgsPointXY &p ) { mCoordsLabel->setText( p.toString( mMousePrecisionDecimalPlaces ) ); @@ -843,8 +828,6 @@ void QgsGeoreferencerMainWindow::updateMouseCoordinatePrecision() mMousePrecisionDecimalPlaces = dp; } -// ------------------------------ private ---------------------------------- // -// Gui void QgsGeoreferencerMainWindow::createActions() { // File actions @@ -1019,7 +1002,6 @@ void QgsGeoreferencerMainWindow::createMenus() mPanelMenu = new QMenu( tr( "Panels" ) ); mPanelMenu->setObjectName( QStringLiteral( "mPanelMenu" ) ); mPanelMenu->addAction( dockWidgetGCPpoints->toggleViewAction() ); - // mPanelMenu->addAction(dockWidgetLogView->toggleViewAction()); mToolbarMenu = new QMenu( tr( "Toolbars" ) ); mToolbarMenu->setObjectName( QStringLiteral( "mToolbarMenu" ) ); @@ -1039,7 +1021,7 @@ void QgsGeoreferencerMainWindow::createMenus() menuView->addMenu( mPanelMenu ); menuView->addMenu( mToolbarMenu ); } - else // if ( layout == QDialogButtonBox::KdeLayout ) + else { menuSettings->addSeparator(); menuSettings->addMenu( mPanelMenu ); @@ -1049,20 +1031,11 @@ void QgsGeoreferencerMainWindow::createMenus() void QgsGeoreferencerMainWindow::createDockWidgets() { - // mLogViewer = new QPlainTextEdit; - // mLogViewer->setReadOnly(true); - // mLogViewer->setWordWrapMode(QTextOption::NoWrap); - // dockWidgetLogView->setWidget(mLogViewer); - mGCPListWidget = new QgsGCPListWidget( this ); mGCPListWidget->setGeorefTransform( &mGeorefTransform ); dockWidgetGCPpoints->setWidget( mGCPListWidget ); connect( mGCPListWidget, &QgsGCPListWidget::jumpToGCP, this, &QgsGeoreferencerMainWindow::recenterOnPoint ); -#if 0 - connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint *, int ) ), - this, SLOT( replaceDataPoint( QgsGeorefDataPoint *, int ) ) ); -#endif connect( mGCPListWidget, static_cast( &QgsGCPListWidget::deleteDataPoint ), this, static_cast( &QgsGeoreferencerMainWindow::deleteDataPoint ) ); connect( mGCPListWidget, &QgsGCPListWidget::pointEnabled, this, &QgsGeoreferencerMainWindow::updateGeorefTransform ); @@ -1158,7 +1131,6 @@ void QgsGeoreferencerMainWindow::removeOldLayer() mCanvas->refresh(); } -// Mapcanvas Plugin void QgsGeoreferencerMainWindow::addRaster( const QString &file ) { QgsRasterLayer::LayerOptions options; @@ -1186,7 +1158,6 @@ void QgsGeoreferencerMainWindow::addRaster( const QString &file ) } } -// Settings void QgsGeoreferencerMainWindow::readSettings() { QgsSettings s; @@ -1217,7 +1188,6 @@ void QgsGeoreferencerMainWindow::writeSettings() s.setValue( QStringLiteral( "/Plugin-GeoReferencer/usezerofortrans" ), mUseZeroForTrans ); } -// GCP points bool QgsGeoreferencerMainWindow::loadGCPs( QString &error ) { QgsCoordinateReferenceSystem actualDestinationCrs; @@ -1228,7 +1198,7 @@ bool QgsGeoreferencerMainWindow::loadGCPs( QString &error ) if ( !error.isEmpty() ) return false; - QgsSettings().setValue( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ), actualDestinationCrs.authid() ); + mTargetCrs = actualDestinationCrs; clearGCPData(); mGCPListWidget->setTargetCrs( actualDestinationCrs, QgsProject::instance()->transformContext() ); @@ -1238,7 +1208,6 @@ bool QgsGeoreferencerMainWindow::loadGCPs( QString &error ) } mSavedPoints = mPoints.asPoints(); - // showMessageInLog(tr("GCP points loaded from"), mGCPpointsFileName); if ( mGCPsDirty ) { mGCPListWidget->setGCPList( &mPoints ); @@ -1253,7 +1222,7 @@ bool QgsGeoreferencerMainWindow::loadGCPs( QString &error ) void QgsGeoreferencerMainWindow::saveGCPs() { QString error; - if ( mPoints.saveGcps( mGCPpointsFileName, mProjection, QgsProject::instance()->transformContext(), error ) ) + if ( mPoints.saveGcps( mGCPpointsFileName, mTargetCrs, QgsProject::instance()->transformContext(), error ) ) { mSavedPoints = mPoints.asPoints(); } @@ -1286,7 +1255,6 @@ QgsGeoreferencerMainWindow::SaveGCPs QgsGeoreferencerMainWindow::checkNeedGCPSav return QgsGeoreferencerMainWindow::GCPDISCARD; } -// Georeference bool QgsGeoreferencerMainWindow::georeference() { if ( !checkReadyGeoref() ) @@ -1343,7 +1311,7 @@ bool QgsGeoreferencerMainWindow::georeference() { QgsImageWarper warper( this ); int res = warper.warpFile( mRasterFileName, mModifiedRasterFileName, mGeorefTransform, - mResamplingMethod, mUseZeroForTrans, mCompressionMethod, mProjection, mUserResX, mUserResY ); + mResamplingMethod, mUseZeroForTrans, mCompressionMethod, mTargetCrs, mUserResX, mUserResY ); if ( res == 0 ) // fault to compute GCP transform { //TODO: be more specific in the error message @@ -1719,7 +1687,7 @@ bool QgsGeoreferencerMainWindow::writePDFReportFile( const QString &fileName, co currentGCPStrings << tr( "no" ); } - const QgsPointXY transformedDestinationPoint = ( *gcpIt )->transformedDestinationPoint( mProjection, QgsProject::instance()->transformContext() ); + const QgsPointXY transformedDestinationPoint = ( *gcpIt )->transformedDestinationPoint( mTargetCrs, QgsProject::instance()->transformContext() ); currentGCPStrings << QString::number( ( *gcpIt )->sourcePoint().x(), 'f', 0 ) << QString::number( ( *gcpIt )->sourcePoint().y(), 'f', 0 ) << QString::number( transformedDestinationPoint.x(), 'f', 3 ) << QString::number( transformedDestinationPoint.y(), 'f', 3 ) << QString::number( residual.x() ) << QString::number( residual.y() ) << QString::number( residualTot ); @@ -1782,7 +1750,6 @@ void QgsGeoreferencerMainWindow::updateTransformParamLabel() mTransformParamLabel->setText( labelString ); } -// Gdal script void QgsGeoreferencerMainWindow::showGDALScript( const QStringList &commands ) { QString script = commands.join( QLatin1Char( '\n' ) ) + '\n'; @@ -1827,7 +1794,7 @@ QString QgsGeoreferencerMainWindow::generateGDALtranslateCommand( bool generateT for ( QgsGeorefDataPoint *pt : std::as_const( mPoints ) ) { - const QgsPointXY transformedDestinationPoint = pt->transformedDestinationPoint( mProjection, QgsProject::instance()->transformContext() ); + const QgsPointXY transformedDestinationPoint = pt->transformedDestinationPoint( mTargetCrs, QgsProject::instance()->transformContext() ); gdalCommand << QStringLiteral( "-gcp %1 %2 %3 %4" ).arg( pt->sourcePoint().x() ).arg( -pt->sourcePoint().y() ) .arg( transformedDestinationPoint.x() ).arg( transformedDestinationPoint.y() ); } @@ -1862,13 +1829,13 @@ QString QgsGeoreferencerMainWindow::generateGDALwarpCommand( const QString &resa gdalCommand << QStringLiteral( "-tr" ) << QString::number( targetResX, 'f' ) << QString::number( targetResY, 'f' ); } - if ( mProjection.authid().startsWith( QStringLiteral( "EPSG:" ), Qt::CaseInsensitive ) ) + if ( mTargetCrs.authid().startsWith( QStringLiteral( "EPSG:" ), Qt::CaseInsensitive ) ) { - gdalCommand << QStringLiteral( "-t_srs %1" ).arg( mProjection.authid() ); + gdalCommand << QStringLiteral( "-t_srs %1" ).arg( mTargetCrs.authid() ); } else { - gdalCommand << QStringLiteral( "-t_srs \"%1\"" ).arg( mProjection.toProj().simplified() ); + gdalCommand << QStringLiteral( "-t_srs \"%1\"" ).arg( mTargetCrs.toProj().simplified() ); } gdalCommand << QStringLiteral( "\"%1\"" ).arg( mTranslatedRasterFileName ) << QStringLiteral( "\"%1\"" ).arg( mModifiedRasterFileName ); @@ -1876,20 +1843,6 @@ QString QgsGeoreferencerMainWindow::generateGDALwarpCommand( const QString &resa return gdalCommand.join( QLatin1Char( ' ' ) ); } -// Log -//void QgsGeorefPluginGui::showMessageInLog(const QString &description, const QString &msg) -//{ -// QString logItem = QString("%1: %2").arg(description).arg(msg); -// -// mLogViewer->appendHtml(logItem); -//} -// -//void QgsGeorefPluginGui::clearLog() -//{ -// mLogViewer->clear(); -//} - -// Helpers bool QgsGeoreferencerMainWindow::checkReadyGeoref() { if ( mRasterFileName.isEmpty() ) @@ -1925,7 +1878,6 @@ bool QgsGeoreferencerMainWindow::checkReadyGeoref() if ( !updateGeorefTransform() ) { mMessageBar->pushMessage( tr( "Transform Failed" ), tr( "Failed to compute GCP transform: Transform is not solvable." ), Qgis::MessageLevel::Critical ); - // logRequaredGCPs(); return false; } @@ -1937,7 +1889,7 @@ bool QgsGeoreferencerMainWindow::updateGeorefTransform() QVector sourceCoordinates; QVector destinationCoords; if ( mGCPListWidget->gcpList() ) - mGCPListWidget->gcpList()->createGCPVectors( sourceCoordinates, destinationCoords, mProjection, QgsProject::instance()->transformContext() ); + mGCPListWidget->gcpList()->createGCPVectors( sourceCoordinates, destinationCoords, mTargetCrs, QgsProject::instance()->transformContext() ); else return false; @@ -2082,24 +2034,6 @@ bool QgsGeoreferencerMainWindow::equalGCPlists( const QList< QgsGcpPoint > &list return true; } -//void QgsGeorefPluginGui::logTransformOptions() -//{ -// showMessageInLog(tr("Interpolation"), convertResamplingEnumToString(mResamplingMethod)); -// showMessageInLog(tr("Compression method"), mCompressionMethod); -// showMessageInLog(tr("Zero for transparency"), mUseZeroForTrans ? "true" : "false"); -//} -// -//void QgsGeorefPluginGui::logRequaredGCPs() -//{ -// if (mGeorefTransform.minimumGcpCount() != 0) -// { -// if ((uint)mPoints.size() >= mGeorefTransform.minimumGcpCount()) -// showMessageInLog(tr("Info"), tr("For georeferencing required at least %n GCP point(s)", nullptr, mGeorefTransform.minimumGcpCount())); -// else -// showMessageInLog(tr("Critical"), tr("For georeferencing required at least %n GCP point(s)", nullptr, mGeorefTransform.minimumGcpCount())); -// } -//} - void QgsGeoreferencerMainWindow::clearGCPData() { //force all list widget editors to close before removing data points diff --git a/src/app/georeferencer/qgsgeorefmainwindow.h b/src/app/georeferencer/qgsgeorefmainwindow.h index 4b05e2b6a580..6c8b1171fb87 100644 --- a/src/app/georeferencer/qgsgeorefmainwindow.h +++ b/src/app/georeferencer/qgsgeorefmainwindow.h @@ -233,7 +233,7 @@ class QgsGeoreferencerMainWindow : public QMainWindow, private Ui::QgsGeorefPlug QString mWorldFileName; QString mTranslatedRasterFileName; QString mGCPpointsFileName; - QgsCoordinateReferenceSystem mProjection; + QgsCoordinateReferenceSystem mTargetCrs; QgsCoordinateReferenceSystem mLastGCPProjection; QString mPdfOutputFile; QString mPdfOutputMapFile; diff --git a/src/app/georeferencer/qgstransformsettingsdialog.cpp b/src/app/georeferencer/qgstransformsettingsdialog.cpp index 8a259ae158e2..1bd2d7fd4e13 100644 --- a/src/app/georeferencer/qgstransformsettingsdialog.cpp +++ b/src/app/georeferencer/qgstransformsettingsdialog.cpp @@ -104,10 +104,6 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c cmbResampling->setCurrentIndex( settings.value( QStringLiteral( "/Plugin-GeoReferencer/lastresampling" ), 0 ).toInt() ); cmbCompressionComboBox->setCurrentIndex( settings.value( QStringLiteral( "/Plugin-GeoReferencer/lastcompression" ), 0 ).toInt() ); - QString targetCRSString = settings.value( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ) ).toString(); - QgsCoordinateReferenceSystem targetCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( targetCRSString ); - mCrsSelector->setCrs( targetCRS ); - mWorldFileCheckBox->setChecked( settings.value( QStringLiteral( "/Plugin-Georeferencer/word_file_checkbox" ), false ).toBool() ); cbxUserResolution->setChecked( settings.value( QStringLiteral( "/Plugin-Georeferencer/user_specified_resolution" ), false ).toBool() ); @@ -126,10 +122,19 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsTransformSettingsDialog::showHelp ); } +void QgsTransformSettingsDialog::setTargetCrs( const QgsCoordinateReferenceSystem &crs ) +{ + mCrsSelector->setCrs( crs ); +} + +QgsCoordinateReferenceSystem QgsTransformSettingsDialog::targetCrs() const +{ + return mCrsSelector->crs(); +} + void QgsTransformSettingsDialog::getTransformSettings( QgsGeorefTransform::TransformMethod &tp, QgsImageWarper::ResamplingMethod &rm, - QString &comprMethod, QString &raster, - QgsCoordinateReferenceSystem &proj, QString &pdfMapFile, QString &pdfReportFile, bool &saveGcpPoints, bool &zt, bool &loadInQgis, + QString &comprMethod, QString &raster, QString &pdfMapFile, QString &pdfReportFile, bool &saveGcpPoints, bool &zt, bool &loadInQgis, double &resX, double &resY ) { if ( cmbTransformType->currentIndex() == -1 ) @@ -147,7 +152,6 @@ void QgsTransformSettingsDialog::getTransformSettings( QgsGeorefTransform::Trans { raster = mOutputRaster->filePath(); } - proj = mCrsSelector->crs(); pdfMapFile = mPdfMap->filePath(); pdfReportFile = mPdfReport->filePath(); zt = cbxZeroAsTrans->isChecked(); diff --git a/src/app/georeferencer/qgstransformsettingsdialog.h b/src/app/georeferencer/qgstransformsettingsdialog.h index 0d456db0236a..a2972075d0ae 100644 --- a/src/app/georeferencer/qgstransformsettingsdialog.h +++ b/src/app/georeferencer/qgstransformsettingsdialog.h @@ -29,9 +29,19 @@ class QgsTransformSettingsDialog : public QDialog, private Ui::QgsTransformSetti public: QgsTransformSettingsDialog( const QString &raster, const QString &output, QWidget *parent = nullptr ); + /** + * Sets the selected target \a crs. + */ + void setTargetCrs( const QgsCoordinateReferenceSystem &crs ); + + /** + * Returns the selected target CRS. + */ + QgsCoordinateReferenceSystem targetCrs() const; + void getTransformSettings( QgsGeorefTransform::TransformMethod &tp, QgsImageWarper::ResamplingMethod &rm, QString &comprMethod, - QString &raster, QgsCoordinateReferenceSystem &proj, QString &pdfMapFile, QString &pdfReportFile, bool &saveGcpPoints, bool &zt, bool &loadInQgis, + QString &raster, QString &pdfMapFile, QString &pdfReportFile, bool &saveGcpPoints, bool &zt, bool &loadInQgis, double &resX, double &resY ); static void resetSettings();