mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
layer crs instead of provider crs in raster save dialog
This commit is contained in:
parent
953c4e0429
commit
a205034999
@ -3924,7 +3924,7 @@ void QgisApp::saveAsRasterFile()
|
||||
return;
|
||||
}
|
||||
|
||||
QgsRasterLayerSaveAsDialog d( rasterLayer->dataProvider(), mMapCanvas->extent(), mMapCanvas->mapRenderer()->destinationCrs() );
|
||||
QgsRasterLayerSaveAsDialog d( rasterLayer->dataProvider(), mMapCanvas->extent(), rasterLayer->crs(), mMapCanvas->mapRenderer()->destinationCrs() );
|
||||
if ( d.exec() == QDialog::Accepted )
|
||||
{
|
||||
QgsRasterFileWriter fileWriter( d.outputFileName() );
|
||||
|
@ -9,11 +9,13 @@
|
||||
#include <QSettings>
|
||||
|
||||
QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterDataProvider* sourceProvider, const QgsRectangle& currentExtent,
|
||||
const QgsCoordinateReferenceSystem& layerCrs,
|
||||
const QgsCoordinateReferenceSystem& currentCrs,
|
||||
QWidget* parent, Qt::WindowFlags f ):
|
||||
QDialog( parent, f )
|
||||
, mDataProvider( sourceProvider )
|
||||
, mCurrentExtent( currentExtent )
|
||||
, mLayerCrs( layerCrs )
|
||||
, mCurrentCrs( currentCrs )
|
||||
, mExtentState( OriginalExtent )
|
||||
, mResolutionState( OriginalResolution )
|
||||
@ -40,7 +42,7 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterDataProvider* s
|
||||
if ( mDataProvider )
|
||||
{
|
||||
//extent
|
||||
setOutputExtent( mDataProvider->extent(), mDataProvider->crs(), OriginalExtent );
|
||||
setOutputExtent( mDataProvider->extent(), mLayerCrs, OriginalExtent );
|
||||
|
||||
if ( mDataProvider->capabilities() & QgsRasterDataProvider::ExactResolution )
|
||||
{
|
||||
@ -130,7 +132,7 @@ void QgsRasterLayerSaveAsDialog::on_mOriginalExtentButton_clicked()
|
||||
{
|
||||
if ( mDataProvider )
|
||||
{
|
||||
setOutputExtent( mDataProvider->extent(), mDataProvider->crs(), OriginalExtent );
|
||||
setOutputExtent( mDataProvider->extent(), mLayerCrs, OriginalExtent );
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +268,7 @@ void QgsRasterLayerSaveAsDialog::setOriginalResolution()
|
||||
// Init to something if no original resolution is available
|
||||
xRes = yRes = mDataProvider->extent().width() / 100;
|
||||
}
|
||||
setResolution( xRes, yRes, mDataProvider->crs() );
|
||||
setResolution( xRes, yRes, mLayerCrs );
|
||||
mResolutionState = OriginalResolution;
|
||||
recalcSize();
|
||||
}
|
||||
@ -414,7 +416,7 @@ void QgsRasterLayerSaveAsDialog::crsChanged()
|
||||
if ( mExtentState == OriginalExtent )
|
||||
{
|
||||
previousExtent = mDataProvider->extent();
|
||||
previousCrs = mDataProvider->crs();
|
||||
previousCrs = mLayerCrs;
|
||||
}
|
||||
else if ( mExtentState == CurrentExtent )
|
||||
{
|
||||
@ -456,7 +458,7 @@ void QgsRasterLayerSaveAsDialog::updateCrsGroup()
|
||||
QgsDebugMsg( "Entered" );
|
||||
|
||||
mCrsComboBox->setItemText( mCrsComboBox->findData( OriginalCrs ),
|
||||
tr( "Layer" ) + " (" + mDataProvider->crs().description() + ", " + mDataProvider->crs().authid() + ")" );
|
||||
tr( "Layer" ) + " (" + mLayerCrs.description() + ", " + mLayerCrs.authid() + ")" );
|
||||
|
||||
mCrsComboBox->setItemText( mCrsComboBox->findData( CurrentCrs ),
|
||||
tr( "Project" ) + " (" + mCurrentCrs.description() + ", " + mCurrentCrs.authid() + ")" );
|
||||
@ -470,7 +472,7 @@ QgsCoordinateReferenceSystem QgsRasterLayerSaveAsDialog::outputCrs()
|
||||
int state = mCrsComboBox->itemData( mCrsComboBox->currentIndex() ).toInt();
|
||||
if ( state == OriginalCrs )
|
||||
{
|
||||
return mDataProvider->crs();
|
||||
return mLayerCrs;
|
||||
}
|
||||
else if ( state == CurrentCrs )
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ class GUI_EXPORT QgsRasterLayerSaveAsDialog: public QDialog, private Ui::QgsRast
|
||||
UserResolution
|
||||
};
|
||||
|
||||
QgsRasterLayerSaveAsDialog( QgsRasterDataProvider* sourceProvider, const QgsRectangle& currentExtent, const QgsCoordinateReferenceSystem& currentCrs, QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
QgsRasterLayerSaveAsDialog( QgsRasterDataProvider* sourceProvider, const QgsRectangle& currentExtent, const QgsCoordinateReferenceSystem& layerCrs, const QgsCoordinateReferenceSystem& currentCrs, QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
~QgsRasterLayerSaveAsDialog();
|
||||
|
||||
Mode mode() const;
|
||||
@ -82,6 +82,7 @@ class GUI_EXPORT QgsRasterLayerSaveAsDialog: public QDialog, private Ui::QgsRast
|
||||
private:
|
||||
QgsRasterDataProvider* mDataProvider;
|
||||
QgsRectangle mCurrentExtent;
|
||||
QgsCoordinateReferenceSystem mLayerCrs; // may differ from provider CRS
|
||||
QgsCoordinateReferenceSystem mCurrentCrs;
|
||||
QgsCoordinateReferenceSystem mUserCrs;
|
||||
QgsCoordinateReferenceSystem mPreviousCrs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user