21 #ifndef QGSRASTERLAYER_H
22 #define QGSRASTERLAYER_H
24 #include "qgis_core.h"
111 : loadDefaultStyle( loadDefaultStyle )
112 , transformContext( transformContext )
116 bool loadDefaultStyle =
true;
137 bool skipCrsValidation =
false;
154 const QString &baseName = QString(),
155 const QString &providerType =
"gdal",
161 SIP_PYOBJECT __repr__();
163 QString
str = QStringLiteral(
"<QgsRasterLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
164 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
201 static bool isValidRasterFileName(
const QString &fileNameQString, QString &retError );
204 static bool isValidRasterFileName(
const QString &fileNameQString );
207 static QDateTime lastModified(
const QString &name );
213 Q_DECL_DEPRECATED
void setDataProvider(
const QString &provider )
SIP_DEPRECATED;
222 void setDataProvider(
const QString &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
304 int bandCount()
const;
309 QString bandName(
int bandNoInt )
const;
325 void reload() override;
329 void draw( QPainter *theQPainter,
340 bool isSpatial()
const override {
return true; }
348 QPixmap paletteAsPixmap(
int bandNumber = 1 );
361 double rasterUnitsPerPixelX()
const;
370 double rasterUnitsPerPixelY()
const;
387 bool generateLookupTableFlag = true );
406 virtual QString subsetString() const;
416 virtual
bool setSubsetString( const QString &subset );
422 bool defaultContrastEnhancementSettings(
427 void setDefaultContrastEnhancement();
429 QStringList subLayers() const override;
435 QImage previewAsImage( QSize size, const QColor &bgColor = Qt::white,
436 QImage::Format format = QImage::Format_ARGB32_Premultiplied );
438 void setLayerOrder( const QStringList &layers ) override;
439 void setSubLayerVisibility( const QString &name,
bool vis ) override;
440 QDateTime timestamp() const override;
452 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
462 bool ignoreExtents() const;
467 void showStatusMessage( const QString &message );
482 void subsetStringChanged();
489 bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage,
491 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
493 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
494 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
495 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
502 void closeDataProvider();
508 void setRendererForDrawingStyle(
QgsRaster::DrawingStyle drawingStyle );
514 bool generateLookupTableFlag,
520 void computeMinMax(
int band,
525 double &min,
double &max );
538 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const
QgsDataProvider::ProviderOptions &options,
QgsDataProvider::ReadFlags flags ) override;
541 const QString QSTRING_NOT_SET;
542 const QString TRSTRING_NOT_SET;
551 QDateTime mLastModified;
560 QgsRectangle mLastRectangleUsedByRefreshContrastEnhancementIfNeeded;
562 QDomDocument mOriginalStyleDocument;
563 QDomElement mOriginalStyleElement;
Brightness/contrast and gamma correction filter pipe for rasters.
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used.
Contains information about the context in which a coordinate transform is executed.
Abstract base class for spatial data provider implementations.
Color and saturation filter pipe for rasters.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for storage of map layer temporal properties.
Base class for all map layer types.
QString providerType() const
Returns the provider type (provider key) for this layer.
virtual void setOpacity(double opacity)
Sets the opacity for the layer, where opacity is a value between 0 (totally transparent) and 1....
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
virtual QString htmlMetadata() const
Obtain a formatted HTML string containing assorted metadata for this layer.
virtual Q_INVOKABLE QgsDataProvider * dataProvider()
Returns the layer's data provider, it may be nullptr.
Perform transforms between map coordinates and device coordinates.
Base class for raster data providers.
Implementation of map layer temporal properties for raster layers.
Represents a raster layer.
QgsRasterPipe::ResamplingStage resamplingStage() const
Returns which stage of the pipe should apply resampling.
LayerType
This enumerator describes the type of raster layer.
ColorShadingAlgorithm
This enumerator describes the types of shading that can be used.
QgsRasterPipe * pipe()
Returns the raster pipe.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm MULTIPLE_BAND_SINGLE_BYTE_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for multiple band raster of type Byte.
QgsHueSaturationFilter * hueSaturationFilter() const
Returns the raster's hue/saturation filter.
static const QgsRasterMinMaxOrigin::Limits SINGLE_BAND_MIN_MAX_LIMITS
Default enhancement limits for single band raster.
static const QgsRasterMinMaxOrigin::Limits MULTIPLE_BAND_MULTI_BYTE_MIN_MAX_LIMITS
Default enhancement limits for multiple band raster of type different from Byte.
LayerType rasterType()
Returns the raster layer type (which is a read only property).
static const double SAMPLE_SIZE
Default sample size (number of pixels) for estimated statistics/histogram calculation.
static const QgsRasterMinMaxOrigin::Limits MULTIPLE_BAND_SINGLE_BYTE_MIN_MAX_LIMITS
Default enhancement limits for multiple band raster of type Byte.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm MULTIPLE_BAND_MULTI_BYTE_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for multiple band raster of type different from Byte.
QgsRasterResampleFilter * resampleFilter() const
Returns the raster's resample filter.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm SINGLE_BAND_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for single band raster.
QgsBrightnessContrastFilter * brightnessFilter() const
Returns the raster's brightness/contrast filter.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
This class describes the origin of min/max values.
Limits
This enumerator describes the limits used to compute min/max values.
Base class for processing modules.
ResamplingStage
Stage at which resampling occurs.
Raster renderer pipe that applies colors to a raster.
Resample filter pipe for rasters.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
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 allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
QList< QPair< QString, QColor > > QgsLegendColorList
Setting options for creating vector data providers.
Setting options for loading raster layers.
LayerOptions(bool loadDefaultStyle=true, const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions.
This class provides details of the viewable area that a raster will be rendered into.