121 : loadDefaultStyle( loadDefaultStyle )
122 , transformContext( transformContext )
126 bool loadDefaultStyle =
true;
147 bool skipCrsValidation =
false;
164 const QString &baseName = QString(),
165 const QString &providerType =
"gdal",
171 SIP_PYOBJECT __repr__();
173 QString str = QStringLiteral(
"<QgsRasterLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
174 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
193 static
bool isValidRasterFileName( const QString &fileNameQString, QString &retError );
196 static
bool isValidRasterFileName( const QString &fileNameQString );
199 static QDateTime lastModified( const QString &name );
205 Q_DECL_DEPRECATED
void setDataProvider( const QString &provider )
SIP_DEPRECATED;
214 void setDataProvider( const QString &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags flags =
Qgis::DataProviderReadFlags() );
219 Qgis::RasterLayerType rasterType()
const {
return mRasterType; }
296 int bandCount()
const;
301 QString bandName(
int bandNoInt )
const;
313 int attributeTableCount( )
const;
319 bool canCreateRasterAttributeTable( );
335 void reload() override;
339 void draw( QPainter *theQPainter,
350 bool isSpatial()
const override {
return true; }
359 QPixmap paletteAsPixmap(
int bandNumber = 1 );
372 double rasterUnitsPerPixelX()
const;
381 double rasterUnitsPerPixelY()
const;
395 Qgis::RasterRangeLimit limits =
Qgis::RasterRangeLimit::MinimumMaximum,
398 bool generateLookupTableFlag = true );
411 virtual QString subsetString() const;
421 virtual
bool setSubsetString( const QString &subset );
427 bool defaultContrastEnhancementSettings(
432 void setDefaultContrastEnhancement();
434 QStringList subLayers() const override;
439 QImage previewAsImage( QSize size, const QColor &bgColor = Qt::white,
440 QImage::Format format = QImage::Format_ARGB32_Premultiplied );
442 void setLayerOrder( const QStringList &layers ) override;
443 void setSubLayerVisibility( const QString &name,
bool vis ) override;
444 QDateTime timestamp() const override;
456 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
466 bool ignoreExtents() const;
478 void computeMinMax(
int band,
480 Qgis::RasterRangeLimit limits,
483 double &min,
double &max )
SIP_SKIP;
486 void showStatusMessage( const QString &message );
501 void subsetStringChanged();
507 bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage,
509 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
511 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
512 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
513 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
520 void closeDataProvider();
526 void setRendererForDrawingStyle(
Qgis::RasterDrawingStyle drawingStyle );
529 Qgis::RasterRangeLimit limits,
532 bool generateLookupTableFlag,
546 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags flags ) override;
555 void writeRasterAttributeTableExternalPaths( QDomNode &layerNode, QDomDocument &doc, const
QgsReadWriteContext &context ) const;
563 void readRasterAttributeTableExternalPaths( const QDomNode &layerNode,
QgsReadWriteContext &context ) const;
566 const QString QSTRING_NOT_SET;
567 const QString TRSTRING_NOT_SET;
578 QDateTime mLastModified;
582 Qgis::RasterLayerType mRasterType =
Qgis::RasterLayerType::GrayOrUndefined;
586 QDomDocument mOriginalStyleDocument;
587 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.