36#include <QRegularExpression>
41 QWidget *parent, Qt::WindowFlags f )
42 : QDialog( parent, f )
43 , mRasterLayer( rasterLayer )
44 , mDataProvider( sourceProvider )
45 , mCurrentExtent( currentExtent )
46 , mLayerCrs( layerCrs )
47 , mCurrentCrs( currentCrs )
48 , mResolutionState( OriginalResolution )
52 connect( mRawModeRadioButton, &QRadioButton::toggled,
this, &QgsRasterLayerSaveAsDialog::mRawModeRadioButton_toggled );
53 connect( mFormatComboBox, &QComboBox::currentTextChanged,
this, &QgsRasterLayerSaveAsDialog::mFormatComboBox_currentIndexChanged );
54 connect( mResolutionRadioButton, &QRadioButton::toggled,
this, &QgsRasterLayerSaveAsDialog::mResolutionRadioButton_toggled );
55 connect( mOriginalResolutionPushButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mOriginalResolutionPushButton_clicked );
56 connect( mXResolutionLineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerSaveAsDialog::mXResolutionLineEdit_textEdited );
57 connect( mYResolutionLineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerSaveAsDialog::mYResolutionLineEdit_textEdited );
58 connect( mOriginalSizePushButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mOriginalSizePushButton_clicked );
59 connect( mColumnsLineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerSaveAsDialog::mColumnsLineEdit_textEdited );
60 connect( mRowsLineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerSaveAsDialog::mRowsLineEdit_textEdited );
61 connect( mAddNoDataManuallyToolButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mAddNoDataManuallyToolButton_clicked );
62 connect( mLoadTransparentNoDataToolButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mLoadTransparentNoDataToolButton_clicked );
63 connect( mRemoveSelectedNoDataToolButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mRemoveSelectedNoDataToolButton_clicked );
64 connect( mRemoveAllNoDataToolButton, &QPushButton::clicked,
this, &QgsRasterLayerSaveAsDialog::mRemoveAllNoDataToolButton_clicked );
65 connect( mTileModeCheckBox, &QCheckBox::toggled,
this, &QgsRasterLayerSaveAsDialog::mTileModeCheckBox_toggled );
66 connect( mPyramidsGroupBox, &QgsCollapsibleGroupBox::toggled,
this, &QgsRasterLayerSaveAsDialog::mPyramidsGroupBox_toggled );
72 mNoDataTableWidget->setColumnCount( 2 );
73 mNoDataTableWidget->setHorizontalHeaderItem( 0,
new QTableWidgetItem( tr(
"From" ) ) );
74 mNoDataTableWidget->setHorizontalHeaderItem( 1,
new QTableWidgetItem( tr(
"To" ) ) );
76 mRawModeRadioButton_toggled(
true );
80 toggleResolutionSize();
82 insertAvailableOutputFormats();
89 setOriginalResolution();
90 int xSize = mDataProvider->
xSize();
91 int ySize = mDataProvider->
ySize();
92 mMaximumSizeXLineEdit->setText( QString::number( xSize ) );
93 mMaximumSizeYLineEdit->setText( QString::number( ySize ) );
97 mTileModeCheckBox->setChecked(
true );
98 mMaximumSizeXLineEdit->setText( QString::number( 2000 ) );
99 mMaximumSizeYLineEdit->setText( QString::number( 2000 ) );
103 mCreateOptionsWidget->setProvider( mDataProvider->
name() );
104 if ( mDataProvider->
name() == QLatin1String(
"gdal" ) )
106 mCreateOptionsWidget->setFormat( mFormatComboBox->currentData().toString() );
108 mCreateOptionsWidget->setRasterLayer( mRasterLayer );
109 mCreateOptionsWidget->update();
117 mPyramidsOptionsWidget->createOptionsWidget()->setRasterLayer( mRasterLayer );
122 mPyramidsUseExistingCheckBox->setEnabled(
false );
123 mPyramidsUseExistingCheckBox->setVisible(
false );
125 populatePyramidsLevels();
127 this, &QgsRasterLayerSaveAsDialog::populatePyramidsLevels );
131 mPyramidsGroupBox->setEnabled(
false );
132 mPyramidsGroupBox->setCollapsed(
true );
137 mCreateOptionsGroupBox->setSaveCheckedState(
true );
147 mCrsSelector->setSourceEnsemble( ensemble.
name() );
153 mCrsSelector->setShowAccuracyWarnings(
true );
155 mCrsSelector->setLayerCrs( mLayerCrs );
157 mCrsSelector->setCrs( mLayerCrs );
160 this, &QgsRasterLayerSaveAsDialog::crsChanged );
162 QPushButton *okButton = mButtonBox->button( QDialogButtonBox::Ok );
165 okButton->setEnabled(
false );
169 mHelpButtonBox->setVisible(
false );
170 mButtonBox->addButton( QDialogButtonBox::Help );
171 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsRasterLayerSaveAsDialog::showHelp );
173 connect( mHelpButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsRasterLayerSaveAsDialog::showHelp );
176 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QgsRasterLayerSaveAsDialog::reject );
178 mExtentGroupBox->setOutputCrs(
outputCrs() );
179 mExtentGroupBox->setOriginalExtent( mDataProvider->
extent(), mLayerCrs );
180 mExtentGroupBox->setCurrentExtent( mCurrentExtent, mCurrentCrs );
181 mExtentGroupBox->setOutputExtentFromOriginal();
184 recalcResolutionSize();
188 if ( mTileModeCheckBox->isChecked() )
190 mTilesGroupBox->show();
192 mFilename->setDialogTitle( tr(
"Select Output Directory" ) );
196 mTilesGroupBox->hide();
198 mFilename->setDialogTitle( tr(
"Save Layer As" ) );
201 mFilename->setDefaultRoot( settings.
value( QStringLiteral(
"UI/lastRasterFileDir" ), QDir::homePath() ).toString() );
205 QFileInfo tmplFileInfo( filePath );
206 settings.
setValue( QStringLiteral(
"UI/lastRasterFileDir" ), tmplFileInfo.absolutePath() );
208 if ( !filePath.isEmpty() && mLayerName->isEnabled() )
210 QFileInfo fileInfo( filePath );
211 mLayerName->setText( fileInfo.baseName() );
214 if ( mTileModeCheckBox->isChecked() )
216 QString fileName = filePath;
221 if ( fileName.isEmpty() )
225 QDir dir( fileName );
226 QString baseName = QFileInfo( fileName ).baseName();
228 filters << QStringLiteral(
"%1.*" ).arg( baseName );
229 QStringList files = dir.entryList( filters );
230 if ( files.isEmpty() )
233 if ( QMessageBox::warning(
this, tr(
"Save Raster Layer" ),
234 tr(
"The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath(), files.join( QLatin1String(
", " ) ) ),
235 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
238 fileName = QFileDialog::getExistingDirectory(
this, tr(
"Select output directory" ), tmplFileInfo.absolutePath() );
242 QPushButton *okButton = mButtonBox->button( QDialogButtonBox::Ok );
247 okButton->setEnabled( tmplFileInfo.absoluteDir().exists() );
251void QgsRasterLayerSaveAsDialog::insertAvailableOutputFormats()
255 int nDrivers = GDALGetDriverCount();
256 QMap< int, QPair< QString, QString > > topPriorityDrivers;
257 QMap< QString, QString > lowPriorityDrivers;
259 for (
int i = 0; i < nDrivers; ++i )
261 GDALDriverH driver = GDALGetDriver( i );
266 QString driverShortName = GDALGetDriverShortName( driver );
267 QString driverLongName = GDALGetDriverLongName( driver );
268 if ( driverShortName == QLatin1String(
"MEM" ) )
275 else if ( driverShortName == QLatin1String(
"VRT" ) )
280 else if ( driverShortName == QLatin1String(
"GTiff" ) )
283 topPriorityDrivers.insert( 1, qMakePair( driverLongName, driverShortName ) );
285 else if ( driverShortName == QLatin1String(
"GPKG" ) )
288 topPriorityDrivers.insert( 2, qMakePair( driverLongName, driverShortName ) );
292 lowPriorityDrivers.insert( driverLongName, driverShortName );
299 for (
auto priorityDriversIt = topPriorityDrivers.constBegin(); priorityDriversIt != topPriorityDrivers.constEnd(); ++priorityDriversIt )
301 mFormatComboBox->addItem( priorityDriversIt.value().first, priorityDriversIt.value().second );
304 for (
auto lowPriorityDriversIt = lowPriorityDrivers.constBegin(); lowPriorityDriversIt != lowPriorityDrivers.constEnd(); ++lowPriorityDriversIt )
306 mFormatComboBox->addItem( lowPriorityDriversIt.key(), lowPriorityDriversIt.value() );
311void QgsRasterLayerSaveAsDialog::setValidators()
315 mColumnsLineEdit->setValidator(
new QIntValidator(
this ) );
316 mRowsLineEdit->setValidator(
new QIntValidator(
this ) );
317 mMaximumSizeXLineEdit->setValidator(
new QIntValidator(
this ) );
318 mMaximumSizeYLineEdit->setValidator(
new QIntValidator(
this ) );
321void QgsRasterLayerSaveAsDialog::mFormatComboBox_currentIndexChanged(
const QString & )
324 if ( mDataProvider && mDataProvider->
name() == QLatin1String(
"gdal" ) )
327 mCreateOptionsWidget->update();
332 if ( extensions.empty() )
333 filter = tr(
"All files (*.*)" );
336 filter = QStringLiteral(
"%1 (*.%2);;%3" ).arg( mFormatComboBox->currentText(),
337 extensions.join( QLatin1String(
" *." ) ),
338 tr(
"All files (*.*)" ) );
340 mFilename->setFilter( filter );
343 mTileModeCheckBox->setEnabled(
outputFormat() != QLatin1String(
"GPKG" ) );
344 mFilename->setConfirmOverwrite(
outputFormat() != QLatin1String(
"GPKG" ) );
345 mLayerName->setEnabled(
outputFormat() == QLatin1String(
"GPKG" ) );
346 if ( mLayerName->isEnabled() )
348 QString layerName = QFileInfo( mFilename->filePath() ).baseName();
349 mLayerName->setText( layerName );
350 mTileModeCheckBox->setChecked(
false );
354 mLayerName->setText( QString() );
360 return mColumnsLineEdit->text().toInt();
365 return mRowsLineEdit->text().toInt();
380 return mMaximumSizeXLineEdit->text().toInt();
385 return mMaximumSizeYLineEdit->text().toInt();
390 return mTileModeCheckBox->isChecked();
395 return mAddToCanvas->isChecked();
400 mAddToCanvas->setChecked( checked );
405 QString fileName = mFilename->filePath();
411 if ( !extensions.empty() )
413 defaultExt = extensions.at( 0 );
417 QFileInfo fi( fileName );
418 if ( !fileName.isEmpty() && fi.suffix().isEmpty() && !defaultExt.isEmpty() )
420 fileName +=
'.' + defaultExt;
429 if ( mLayerName->text().isEmpty() &&
outputFormat() == QLatin1String(
"GPKG" ) && !mTileModeCheckBox->isChecked() )
432 return QFileInfo( mFilename->filePath() ).baseName();
436 return mLayerName->text();
442 return mFormatComboBox->currentData().toString();
447 QStringList options = mCreateOptionsGroupBox->isChecked() ? mCreateOptionsWidget->options() : QStringList();
451 int indx = options.indexOf( QRegularExpression(
"^RASTER_TABLE=.*", QRegularExpression::CaseInsensitiveOption | QRegularExpression::MultilineOption ) );
454 options.replace( indx, QStringLiteral(
"RASTER_TABLE=%1" ).arg(
outputLayerName() ) );
458 options.append( QStringLiteral(
"RASTER_TABLE=%1" ).arg(
outputLayerName() ) );
462 if ( !outputLayerExists() )
464 indx = options.indexOf( QRegularExpression(
"^APPEND_SUBDATASET=.*", QRegularExpression::CaseInsensitiveOption | QRegularExpression::MultilineOption ) );
467 options.replace( indx, QStringLiteral(
"APPEND_SUBDATASET=YES" ) );
471 options.append( QStringLiteral(
"APPEND_SUBDATASET=YES" ) );
480 return mExtentGroupBox->outputExtent();
485 mFormatLabel->hide();
486 mFormatComboBox->hide();
491 mSaveAsLabel->hide();
493 QPushButton *okButton = mButtonBox->button( QDialogButtonBox::Ok );
496 okButton->setEnabled(
true );
500void QgsRasterLayerSaveAsDialog::toggleResolutionSize()
504 bool on = mResolutionRadioButton->isChecked();
505 mXResolutionLineEdit->setEnabled( on );
506 mYResolutionLineEdit->setEnabled( on );
507 mOriginalResolutionPushButton->setEnabled( on && hasResolution );
508 mColumnsLineEdit->setEnabled( !on );
509 mRowsLineEdit->setEnabled( !on );
510 mOriginalSizePushButton->setEnabled( !on && hasResolution );
513void QgsRasterLayerSaveAsDialog::setOriginalResolution()
525 xRes = yRes = mDataProvider->
extent().
width() / 100;
527 setResolution( xRes, yRes, mLayerCrs );
545 QgsRectangle srcExtent( srsCenter.
x() - xRes / 2, srsCenter.
y() - yRes / 2, srsCenter.
x() + xRes / 2, srsCenter.
y() + yRes / 2 );
548 xRes = extent.
width();
551 mXResolutionLineEdit->setText( QLocale().toString( xRes ) );
552 mYResolutionLineEdit->setText( QLocale().toString( yRes ) );
555void QgsRasterLayerSaveAsDialog::recalcSize()
560 mColumnsLineEdit->setText( QString::number( xSize ) );
561 mRowsLineEdit->setText( QString::number( ySize ) );
562 updateResolutionStateMsg();
565void QgsRasterLayerSaveAsDialog::setOriginalSize()
567 mColumnsLineEdit->setText( QString::number( mDataProvider->
xSize() ) );
568 mRowsLineEdit->setText( QString::number( mDataProvider->
ySize() ) );
572void QgsRasterLayerSaveAsDialog::recalcResolution()
577 mXResolutionLineEdit->setText( QLocale().toString( xRes ) );
578 mYResolutionLineEdit->setText( QLocale().toString( yRes ) );
579 updateResolutionStateMsg();
582void QgsRasterLayerSaveAsDialog::recalcResolutionSize()
584 if ( mResolutionRadioButton->isChecked() )
595void QgsRasterLayerSaveAsDialog::updateResolutionStateMsg()
598 switch ( mResolutionState )
604 msg = tr(
"user defined" );
609 msg = tr(
"Resolution (current: %1)" ).arg( msg );
610 mResolutionGroupBox->setTitle( msg );
613void QgsRasterLayerSaveAsDialog::extentChanged()
616 if ( mSizeRadioButton->isChecked() )
620 recalcResolutionSize();
623void QgsRasterLayerSaveAsDialog::crsChanged()
627 mExtentGroupBox->setOutputCrs(
outputCrs() );
630 if ( mResolutionRadioButton->isChecked() )
634 setOriginalResolution();
653 return mCrsSelector->crs();
662void QgsRasterLayerSaveAsDialog::mRawModeRadioButton_toggled(
bool checked )
664 mNoDataGroupBox->setEnabled( checked && mDataProvider->
bandCount() == 1 );
665 mNoDataGroupBox->setCollapsed( !mNoDataGroupBox->isEnabled() );
668void QgsRasterLayerSaveAsDialog::mAddNoDataManuallyToolButton_clicked()
670 addNoDataRow( std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN() );
673void QgsRasterLayerSaveAsDialog::mLoadTransparentNoDataToolButton_clicked()
675 if ( !mRasterLayer->
renderer() )
return;
677 if ( !rasterTransparency )
return;
682 if ( transparencyPixel.percentTransparent == 100 )
684 addNoDataRow( transparencyPixel.min, transparencyPixel.max );
685 if ( transparencyPixel.min != transparencyPixel.max )
687 setNoDataToEdited( mNoDataTableWidget->rowCount() - 1 );
693void QgsRasterLayerSaveAsDialog::mRemoveSelectedNoDataToolButton_clicked()
695 mNoDataTableWidget->removeRow( mNoDataTableWidget->currentRow() );
698void QgsRasterLayerSaveAsDialog::mRemoveAllNoDataToolButton_clicked()
700 while ( mNoDataTableWidget->rowCount() > 0 )
702 mNoDataTableWidget->removeRow( 0 );
706void QgsRasterLayerSaveAsDialog::addNoDataRow(
double min,
double max )
708 mNoDataTableWidget->insertRow( mNoDataTableWidget->rowCount() );
709 for (
int i = 0; i < 2; i++ )
711 double value = i == 0 ? min : max;
712 QLineEdit *lineEdit =
new QLineEdit();
713 lineEdit->setFrame(
false );
714 lineEdit->setContentsMargins( 1, 1, 1, 1 );
721 if ( !std::isnan( value ) )
727 lineEdit->setValidator(
new QIntValidator(
nullptr ) );
728 if ( !std::isnan( value ) )
730 valueString = QLocale().toString(
static_cast<int>( value ) );
734 lineEdit->setText( valueString );
735 mNoDataTableWidget->setCellWidget( mNoDataTableWidget->rowCount() - 1, i, lineEdit );
737 adjustNoDataCellWidth( mNoDataTableWidget->rowCount() - 1, i );
739 connect( lineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerSaveAsDialog::noDataCellTextEdited );
741 mNoDataTableWidget->resizeColumnsToContents();
742 mNoDataTableWidget->resizeRowsToContents();
745void QgsRasterLayerSaveAsDialog::noDataCellTextEdited(
const QString &text )
749 QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
750 if ( !lineEdit )
return;
753 for (
int r = 0; r < mNoDataTableWidget->rowCount(); r++ )
755 for (
int c = 0;
c < mNoDataTableWidget->columnCount();
c++ )
757 if ( mNoDataTableWidget->cellWidget( r,
c ) == sender() )
764 if ( row != -1 )
break;
766 QgsDebugMsgLevel( QStringLiteral(
"row = %1 column =%2" ).arg( row ).arg( column ), 2 );
770 QLineEdit *toLineEdit =
dynamic_cast<QLineEdit *
>( mNoDataTableWidget->cellWidget( row, 1 ) );
771 if ( !toLineEdit )
return;
772 bool toChanged = mNoDataToEdited.value( row );
776 toLineEdit->setText( lineEdit->text() );
779 else if ( column == 1 )
781 setNoDataToEdited( row );
785void QgsRasterLayerSaveAsDialog::mTileModeCheckBox_toggled(
bool toggled )
804 mTilesGroupBox->show();
806 mFilename->setDialogTitle( tr(
"Select Output Directory" ) );
810 mTilesGroupBox->hide();
812 mFilename->setDialogTitle( tr(
"Save Layer As" ) );
816void QgsRasterLayerSaveAsDialog::mPyramidsGroupBox_toggled(
bool toggled )
819 populatePyramidsLevels();
822void QgsRasterLayerSaveAsDialog::populatePyramidsLevels()
826 if ( mPyramidsGroupBox->isChecked() )
828 QList<QgsRasterPyramid> myPyramidList;
831 if ( mPyramidsUseExistingCheckBox->isChecked() )
837 if ( ! mPyramidsOptionsWidget->overviewList().isEmpty() )
838 myPyramidList = mDataProvider->
buildPyramidList( mPyramidsOptionsWidget->overviewList() );
842 if ( ! mPyramidsUseExistingCheckBox->isChecked() || pyramid.getExists() )
844 text += QString::number( pyramid.getXDim() ) + QStringLiteral(
"x" ) +
845 QString::number( pyramid.getYDim() ) +
' ';
850 mPyramidResolutionsLineEdit->setText( text.trimmed() );
853void QgsRasterLayerSaveAsDialog::setNoDataToEdited(
int row )
855 if ( row >= mNoDataToEdited.size() )
857 mNoDataToEdited.resize( row + 1 );
859 mNoDataToEdited[row] =
true;
862double QgsRasterLayerSaveAsDialog::noDataCellValue(
int row,
int column )
const
864 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( mNoDataTableWidget->cellWidget( row, column ) );
865 if ( !lineEdit || lineEdit->text().isEmpty() )
867 return std::numeric_limits<double>::quiet_NaN();
872void QgsRasterLayerSaveAsDialog::adjustNoDataCellWidth(
int row,
int column )
874 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( mNoDataTableWidget->cellWidget( row, column ) );
875 if ( !lineEdit )
return;
877 int width = std::max( lineEdit->fontMetrics().boundingRect( lineEdit->text() ).width() + 10, 100 );
878 width = std::max( width, mNoDataTableWidget->columnWidth( column ) );
880 lineEdit->setFixedWidth( width );
886 if ( ! mNoDataGroupBox->isChecked() )
889 int rows = mNoDataTableWidget->rowCount();
890 noDataList.reserve( rows );
891 for (
int r = 0; r < rows; r++ )
894 noDataList.append(
noData );
902 return mPyramidsGroupBox->isChecked() ? mPyramidsOptionsWidget->overviewList() : QList<int>();
907 if ( ! mPyramidsGroupBox->isChecked() )
909 else if ( mPyramidsUseExistingCheckBox->isChecked() )
915bool QgsRasterLayerSaveAsDialog::validate()
const
917 if ( mCreateOptionsGroupBox->isChecked() )
919 QString message = mCreateOptionsWidget->validateOptions(
true,
false );
920 if ( !message.isNull() )
923 if ( mPyramidsGroupBox->isChecked() )
925 QString message = mPyramidsOptionsWidget->createOptionsWidget()->validateOptions(
true,
false );
926 if ( !message.isNull() )
932bool QgsRasterLayerSaveAsDialog::outputLayerExists()
const
946 QgsRasterLayer rasterLayer( rasterUri, QString( ), QStringLiteral(
"gdal" ) );
947 if ( !vectorUri.isEmpty() )
949 QgsVectorLayer vectorLayer( vectorUri, QString( ), QStringLiteral(
"ogr" ) );
950 return rasterLayer.isValid() || vectorLayer.isValid();
954 return rasterLayer.isValid();
965 if (
outputFormat() == QLatin1String(
"GPKG" ) && outputLayerExists() &&
966 QMessageBox::warning(
this, tr(
"Save Raster Layer" ),
967 tr(
"The layer %1 already exists in the target file, and overwriting layers in GeoPackage is not supported. "
969 QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
977void QgsRasterLayerSaveAsDialog::showHelp()
979 QgsHelp::openHelp( QStringLiteral(
"managing_data_source/create_layers.html#creating-new-layers-from-an-existing-layer" ) );
@ Float32
Thirty two bit floating point (float)
@ Float64
Sixty four bit floating point (double)
RasterBuildPyramidOption
Raster pyramid building options.
@ CopyExisting
Copy existing.
@ Reverse
Reverse/inverse transform (from destination to source)
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
This class represents a coordinate reference system (CRS).
QgsDatumEnsemble datumEnsemble() const
Attempts to retrieve datum ensemble details from the CRS.
virtual QString name() const =0
Returns a provider name.
Contains information about a datum ensemble.
bool isValid() const
Returns true if the datum ensemble is a valid object, or false if it is a null/invalid object.
QString name() const
Display name of datum ensemble.
QgsDoubleValidator is a QLineEdit Validator that combines QDoubleValidator and QRegularExpressionVali...
static double toDouble(const QString &input, bool *ok)
Converts input string to double value.
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.
static bool supportsRasterCreate(GDALDriverH driver)
Reads whether a driver supports GDALCreate() for raster purposes.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Custom exception class which is raised when an operation is not supported.
A class to represent a 2D point.
static QgsProject * instance()
Returns the QgsProject singleton instance.
static QString printValue(double value)
Print double value with all necessary significant digits.
Base class for raster data providers.
Qgis::DataType sourceDataType(int bandNo) const override=0
Returns source data type for the band specified by number, source data type may be shorter than dataT...
QgsRectangle extent() const override=0
Returns the extent of the layer.
virtual QList< QgsRasterPyramid > buildPyramidList(const QList< int > &overviewList=QList< int >())
Returns the raster layers pyramid list.
static QStringList extensionsForFormat(const QString &format)
Returns a list of known file extensions for the given GDAL driver format.
@ BuildPyramids
Supports building of pyramids (overviews)
@ Size
Original data source size (and thus resolution) is known, it is not always available,...
virtual int xSize() const
Gets raster size.
virtual int bandCount() const =0
Gets number of bands.
virtual int capabilities() const
Returns a bitmask containing the supported capabilities.
virtual int ySize() const
double xResolution() const
double yResolution() const
QgsRasterRangeList noData() const
int maximumTileSizeX() const
QString outputLayerName() const
Name of the output layer within GeoPackage file.
QList< int > pyramidsList() const
Qgis::RasterBuildPyramidOption buildPyramidsFlag() const
Returns the pyramid building option.
QString outputFormat() const
QgsRectangle outputRectangle() const
QgsRasterLayerSaveAsDialog(QgsRasterLayer *rasterLayer, QgsRasterDataProvider *sourceProvider, const QgsRectangle ¤tExtent, const QgsCoordinateReferenceSystem &layerCrs, const QgsCoordinateReferenceSystem ¤tCrs, QWidget *parent SIP_TRANSFERTHIS=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Constructor for QgsRasterLayerSaveAsDialog.
bool addToCanvas() const
Returns true if the "add to canvas" checkbox is checked.
QStringList createOptions() const
int maximumTileSizeY() const
void setAddToCanvas(bool checked)
Sets whether the "add to canvas" checkbox should be checked.
QgsCoordinateReferenceSystem outputCrs()
QString outputFileName() const
Represents a raster layer.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
This struct is used to store pyramid info for the raster layer.
Raster values range container.
const QgsRasterTransparency * rasterTransparency() const
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
QList< QgsRasterTransparency::TransparentSingleValuePixel > transparentSingleValuePixelList() const
Returns the transparent single value pixel list.
A rectangle specified with double values.
double width() const
Returns the width of the rectangle.
QgsPointXY center() const
Returns the center point of the rectangle.
double height() const
Returns the height of the rectangle.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
Represents a vector layer which manages a vector based data sets.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define QgsDebugMsgLevel(str, level)
QList< QgsRasterRange > QgsRasterRangeList