122 : loadDefaultStyle( loadDefaultStyle )
123 , transformContext( transformContext )
127 bool loadDefaultStyle =
true;
148 bool skipCrsValidation =
false;
165 const QString &baseName = QString(),
166 const QString &providerType =
"gdal",
172 SIP_PYOBJECT __repr__();
174 QString str = QStringLiteral(
"<QgsRasterLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
175 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
194 static
bool isValidRasterFileName( const QString &fileNameQString, QString &retError );
197 static
bool isValidRasterFileName( const QString &fileNameQString );
200 static QDateTime lastModified( const QString &name );
206 Q_DECL_DEPRECATED
void setDataProvider( const QString &provider )
SIP_DEPRECATED;
215 void setDataProvider( const QString &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags flags =
Qgis::DataProviderReadFlags() );
220 Qgis::RasterLayerType rasterType()
const {
return mRasterType; }
297 int bandCount()
const;
302 QString bandName(
int bandNoInt )
const;
314 int attributeTableCount( )
const;
320 bool canCreateRasterAttributeTable( );
336 void reload() override;
340 void draw( QPainter *theQPainter,
351 bool isSpatial()
const override {
return true; }
360 QPixmap paletteAsPixmap(
int bandNumber = 1 );
373 double rasterUnitsPerPixelX()
const;
382 double rasterUnitsPerPixelY()
const;
396 Qgis::RasterRangeLimit limits =
Qgis::RasterRangeLimit::MinimumMaximum,
399 bool generateLookupTableFlag = true );
412 virtual QString subsetString() const;
422 virtual
bool setSubsetString( const QString &subset );
428 bool defaultContrastEnhancementSettings(
433 void setDefaultContrastEnhancement();
435 QStringList subLayers() const override;
440 QImage previewAsImage( QSize size, const QColor &bgColor = Qt::white,
441 QImage::Format format = QImage::Format_ARGB32_Premultiplied );
443 void setLayerOrder( const QStringList &layers ) override;
444 void setSubLayerVisibility( const QString &name,
bool vis ) override;
445 QDateTime timestamp() const override;
456 bool labelsEnabled() const;
468 void setLabelsEnabled(
bool enabled );
511 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
521 bool ignoreExtents() const;
533 void computeMinMax(
int band,
535 Qgis::RasterRangeLimit limits,
538 double &min,
double &max )
SIP_SKIP;
541 void showStatusMessage( const QString &message );
556 void subsetStringChanged();
562 bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage,
564 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
566 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
567 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
568 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
575 void closeDataProvider();
581 void setRendererForDrawingStyle(
Qgis::RasterDrawingStyle drawingStyle );
584 Qgis::RasterRangeLimit limits,
587 bool generateLookupTableFlag,
601 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags flags ) override;
610 void writeRasterAttributeTableExternalPaths( QDomNode &layerNode, QDomDocument &doc, const
QgsReadWriteContext &context ) const;
618 void readRasterAttributeTableExternalPaths( const QDomNode &layerNode,
QgsReadWriteContext &context ) const;
621 const QString QSTRING_NOT_SET;
622 const QString TRSTRING_NOT_SET;
633 bool mLabelsEnabled = false;
639 QDateTime mLastModified;
643 Qgis::RasterLayerType mRasterType =
Qgis::RasterLayerType::GrayOrUndefined;
647 QDomDocument mOriginalStyleDocument;
648 QDomElement mOriginalStyleElement;
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.