QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsrasterdataprovider.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterdataprovider.h - DataProvider Interface for raster layers
3  --------------------------------------
4  Date : Mar 11, 2005
5  Copyright : (C) 2005 by Brendan Morley
6  email : morb at ozemail dot com dot au
7 
8  async legend fetcher : Sandro Santilli < strk at keybit dot net >
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  ***************************************************************************/
20 
21 /* Thank you to Marco Hugentobler for the original vector DataProvider */
22 
23 #ifndef QGSRASTERDATAPROVIDER_H
24 #define QGSRASTERDATAPROVIDER_H
25 
26 #include "qgis_core.h"
27 #include "qgis_sip.h"
28 #include <cmath>
29 
30 #include <QDateTime>
31 #include <QVariant>
32 #include <QImage>
33 
34 #include "qgscolorrampshader.h"
35 #include "qgsdataprovider.h"
36 #include "qgsraster.h"
37 #include "qgsfields.h"
38 #include "qgsrasterinterface.h"
39 #include "qgsrasterpyramid.h"
40 #include "qgsrasterrange.h"
41 #include "qgsrectangle.h"
42 #include "qgsrasteriterator.h"
44 
45 class QImage;
46 class QByteArray;
47 
48 class QgsPointXY;
50 class QgsMapSettings;
51 
57 class CORE_EXPORT QgsImageFetcher : public QObject
58 {
59  Q_OBJECT
60  public:
62  QgsImageFetcher( QObject *parent = nullptr ) : QObject( parent ) {}
63 
68  virtual void start() = 0;
69 
70  signals:
71 
76  void finish( const QImage &legend );
78  void progress( qint64 received, qint64 total );
80  void error( const QString &msg );
81 };
82 
83 
88 class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRasterInterface
89 {
90  Q_OBJECT
91 
92  public:
93 
99  {
100  NoProviderCapabilities = 0,
101  ReadLayerMetadata = 1 << 1,
102  WriteLayerMetadata = 1 << 2,
103  ProviderHintBenefitsFromResampling = 1 << 3,
104  ProviderHintCanPerformProviderResampling = 1 << 4,
105  ReloadData = 1 << 5,
106  DpiDependentData = 1 << 6,
107  };
108 
110  Q_DECLARE_FLAGS( ProviderCapabilities, ProviderCapability )
111 
113 
122  QgsRasterDataProvider( const QString &uri,
124  QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
125 
126  QgsRasterDataProvider *clone() const override = 0;
127 
132  virtual QgsRasterDataProvider::ProviderCapabilities providerCapabilities() const;
133 
134  /* It makes no sense to set input on provider */
135  bool setInput( QgsRasterInterface *input ) override { Q_UNUSED( input ) return false; }
136 
137  QgsRectangle extent() const override = 0;
138 
140  Qgis::DataType dataType( int bandNo ) const override = 0;
141 
147  virtual QgsFields fields() const { return QgsFields(); };
148 
153  Qgis::DataType sourceDataType( int bandNo ) const override = 0;
154 
156  virtual int colorInterpretation( int bandNo ) const;
157 
158  QString colorName( int colorInterpretation ) const
159  {
160  // Modified copy from GDAL
161  switch ( colorInterpretation )
162  {
164  return QStringLiteral( "Undefined" );
165 
167  return QStringLiteral( "Gray" );
168 
170  return QStringLiteral( "Palette" );
171 
172  case QgsRaster::RedBand:
173  return QStringLiteral( "Red" );
174 
176  return QStringLiteral( "Green" );
177 
178  case QgsRaster::BlueBand:
179  return QStringLiteral( "Blue" );
180 
182  return QStringLiteral( "Alpha" );
183 
184  case QgsRaster::HueBand:
185  return QStringLiteral( "Hue" );
186 
188  return QStringLiteral( "Saturation" );
189 
191  return QStringLiteral( "Lightness" );
192 
193  case QgsRaster::CyanBand:
194  return QStringLiteral( "Cyan" );
195 
197  return QStringLiteral( "Magenta" );
198 
200  return QStringLiteral( "Yellow" );
201 
203  return QStringLiteral( "Black" );
204 
206  return QStringLiteral( "YCbCr_Y" );
207 
209  return QStringLiteral( "YCbCr_Cb" );
210 
212  return QStringLiteral( "YCbCr_Cr" );
213 
214  default:
215  return QStringLiteral( "Unknown" );
216  }
217  }
219  virtual bool reload() { return true; }
220 
221  QString colorInterpretationName( int bandNo ) const override;
222 
227  virtual double bandScale( int bandNo ) const { Q_UNUSED( bandNo ) return 1.0; }
228 
233  virtual double bandOffset( int bandNo ) const { Q_UNUSED( bandNo ) return 0.0; }
234 
235  // TODO: remove or make protected all readBlock working with void*
236 
238  QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
239 
241  virtual bool sourceHasNoDataValue( int bandNo ) const { return mSrcHasNoDataValue.value( bandNo - 1 ); }
242 
244  virtual bool useSourceNoDataValue( int bandNo ) const { return mUseSrcNoDataValue.value( bandNo - 1 ); }
245 
247  virtual void setUseSourceNoDataValue( int bandNo, bool use );
248 
250  virtual double sourceNoDataValue( int bandNo ) const { return mSrcNoDataValue.value( bandNo - 1 ); }
251 
252  virtual void setUserNoDataValue( int bandNo, const QgsRasterRangeList &noData );
253 
255  virtual QgsRasterRangeList userNoDataValues( int bandNo ) const { return mUserNoDataValue.value( bandNo - 1 ); }
256 
257  virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const
258  { Q_UNUSED( bandNo ) return QList<QgsColorRampShader::ColorRampItem>(); }
259 
264  QStringList subLayers() const override
265  {
266  return QStringList();
267  }
268 
271 
273  virtual bool supportsLegendGraphic() const { return false; }
274 
286  virtual QImage getLegendGraphic( double scale = 0, bool forceRefresh = false, const QgsRectangle *visibleExtent = nullptr ) SIP_SKIP
287  {
288  Q_UNUSED( scale )
289  Q_UNUSED( forceRefresh )
290  Q_UNUSED( visibleExtent )
291  return QImage();
292  }
293 
308  {
309  Q_UNUSED( mapSettings )
310  return nullptr;
311  }
312 
329  virtual QString buildPyramids( const QList<QgsRasterPyramid> &pyramidList,
330  const QString &resamplingMethod = "NEAREST",
332  const QStringList &configOptions = QStringList(),
333  QgsRasterBlockFeedback *feedback = nullptr )
334  {
335  Q_UNUSED( pyramidList )
336  Q_UNUSED( resamplingMethod )
337  Q_UNUSED( format )
338  Q_UNUSED( configOptions )
339  Q_UNUSED( feedback )
340  return QStringLiteral( "FAILED_NOT_SUPPORTED" );
341  }
342 
361  virtual QList<QgsRasterPyramid> buildPyramidList( const QList<int> &overviewList = QList<int>() )
362  { Q_UNUSED( overviewList ) return QList<QgsRasterPyramid>(); }
363 
373  bool hasPyramids();
374 
379  virtual QString htmlMetadata() = 0;
380 
405  virtual QgsRasterIdentifyResult identify( const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 );
406 
421  virtual double sample( const QgsPointXY &point, int band,
422  bool *ok SIP_OUT = nullptr,
423  const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 );
424 
433  virtual QString lastErrorTitle() = 0;
434 
444  virtual QString lastError() = 0;
445 
447  virtual QString lastErrorFormat();
448 
450  int dpi() const { return mDpi; }
451 
453  void setDpi( int dpi ) { mDpi = dpi; }
454 
456  QDateTime timestamp() const override { return mTimestamp; }
457 
459  QDateTime dataTimestamp() const override { return QDateTime(); }
460 
467  virtual bool isEditable() const { return false; }
468 
479  virtual bool setEditable( bool enabled ) { Q_UNUSED( enabled ) return false; }
480 
481  // TODO: add data type (may be different from band type)
482 
484  virtual bool write( void *data, int band, int width, int height, int xOffset, int yOffset )
485  {
486  Q_UNUSED( data )
487  Q_UNUSED( band )
488  Q_UNUSED( width )
489  Q_UNUSED( height )
490  Q_UNUSED( xOffset )
491  Q_UNUSED( yOffset )
492  return false;
493  }
494 
511  bool writeBlock( QgsRasterBlock *block, int band, int xOffset = 0, int yOffset = 0 );
512 
514  static QgsRasterDataProvider *create( const QString &providerKey,
515  const QString &uri,
516  const QString &format, int nBands,
517  Qgis::DataType type,
518  int width, int height, double *geoTransform,
520  const QStringList &createOptions = QStringList() );
521 
527  virtual bool setNoDataValue( int bandNo, double noDataValue ) { Q_UNUSED( bandNo ) Q_UNUSED( noDataValue ); return false; }
528 
530  virtual bool remove() { return false; }
531 
536  static QList<QPair<QString, QString> > pyramidResamplingMethods( const QString &providerKey );
537 
544  {
545  QString name;
546  QString uri;
547  QString provider;
548  };
549 
556  {
559  int width;
560  int height;
561  QString formula;
562  QList <QgsRasterDataProvider::VirtualRasterInputLayers> rInputLayers;
563 
564  };
565 
571  static QgsRasterDataProvider::VirtualRasterParameters decodeVirtualRasterProviderUri( const QString &uri, bool *ok = nullptr );
572 
578  static QString encodeVirtualRasterProviderUri( const VirtualRasterParameters &parts );
579 
585  virtual QString validateCreationOptions( const QStringList &createOptions, const QString &format )
586  { Q_UNUSED( createOptions ) Q_UNUSED( format ); return QString(); }
587 
593  const QStringList &configOptions, const QString &fileFormat )
594  { Q_UNUSED( pyramidsFormat ) Q_UNUSED( configOptions ); Q_UNUSED( fileFormat ); return QString(); }
595 
596  static QString identifyFormatName( QgsRaster::IdentifyFormat format );
597  static QgsRaster::IdentifyFormat identifyFormatFromName( const QString &formatName );
598  static QString identifyFormatLabel( QgsRaster::IdentifyFormat format );
599  static Capability identifyFormatToCapability( QgsRaster::IdentifyFormat format );
600 
607 
614 
623  virtual QList< double > nativeResolutions() const;
624 
631  virtual bool ignoreExtents() const;
632 
638  {
641  };
642 
655  virtual QgsPoint transformCoordinates( const QgsPoint &point, TransformType type );
656 
657 
664  virtual bool enableProviderResampling( bool enable ) { Q_UNUSED( enable ); return false; }
665 
678  bool isProviderResamplingEnabled() const { return mProviderResamplingEnabled; }
679 
684  enum class ResamplingMethod
685  {
686  Nearest,
687  Bilinear,
688  Cubic,
689  CubicSpline,
690  Lanczos,
691  Average,
692  Mode,
693  Gauss
694  };
695 
702  virtual bool setZoomedInResamplingMethod( ResamplingMethod method ) { Q_UNUSED( method ); return false; }
703 
708  ResamplingMethod zoomedInResamplingMethod() const { return mZoomedInResamplingMethod; }
709 
716  virtual bool setZoomedOutResamplingMethod( ResamplingMethod method ) { Q_UNUSED( method ); return false; }
717 
722  ResamplingMethod zoomedOutResamplingMethod() const { return mZoomedOutResamplingMethod; }
723 
730  virtual bool setMaxOversampling( double factor ) { Q_UNUSED( factor ); return false; }
731 
736  double maxOversampling() const { return mMaxOversampling; }
737 
738  void readXml( const QDomElement &filterElem ) override;
739 
740  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
741 
742  signals:
743 
748  void statusChanged( const QString & ) const;
749 
750  protected:
751 
757  virtual bool readBlock( int bandNo, int xBlock, int yBlock, void *data ) SIP_SKIP
758  { Q_UNUSED( bandNo ) Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); return false; }
759 
765  virtual bool readBlock( int bandNo, QgsRectangle const &viewExtent, int width, int height, void *data, QgsRasterBlockFeedback *feedback = nullptr ) SIP_SKIP
766  { Q_UNUSED( bandNo ) Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); Q_UNUSED( feedback ); return false; }
767 
769  bool userNoDataValuesContains( int bandNo, double value ) const;
770 
772  void copyBaseSettings( const QgsRasterDataProvider &other );
773 
778  int mDpi = -1;
779 
784  //bool hasNoDataValue ( int bandNo );
785 
787  QList<double> mSrcNoDataValue;
788 
790  QList<bool> mSrcHasNoDataValue;
791 
797  QList<bool> mUseSrcNoDataValue;
798 
803  QList< QgsRasterRangeList > mUserNoDataValue;
804 
806 
808  bool mProviderResamplingEnabled = false;
809 
811  ResamplingMethod mZoomedInResamplingMethod = ResamplingMethod::Nearest;
812 
814  ResamplingMethod mZoomedOutResamplingMethod = ResamplingMethod::Nearest;
815 
817  double mMaxOversampling = 2.0;
818 
819  private:
820 
824  std::unique_ptr< QgsRasterDataProviderTemporalCapabilities > mTemporalCapabilities;
825 
826 };
827 
828 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRasterDataProvider::ProviderCapabilities )
829 
830 // clazy:excludeall=qstring-allocations
831 
832 #endif
QgsRasterDataProvider::VirtualRasterInputLayers::uri
QString uri
Definition: qgsrasterdataprovider.h:546
QgsRaster::YCbCr_YBand
@ YCbCr_YBand
Y Luminance.
Definition: qgsraster.h:77
qgsfields.h
QgsRasterDataProvider::zoomedInResamplingMethod
ResamplingMethod zoomedInResamplingMethod() const
Returns resampling method for zoomed-in operations.
Definition: qgsrasterdataprovider.h:708
QgsRaster::MagentaBand
@ MagentaBand
Magenta band of CMYK image.
Definition: qgsraster.h:74
QgsImageFetcher
Handles asynchronous download of images.
Definition: qgsrasterdataprovider.h:57
QgsRasterDataProvider::mSrcNoDataValue
QList< double > mSrcNoDataValue
Source no data value is available and is set to be used or internal no data is available.
Definition: qgsrasterdataprovider.h:787
QgsDataProvider::ProviderOptions
Setting options for creating vector data providers.
Definition: qgsdataprovider.h:107
QgsRasterInterface::writeXml
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Definition: qgsrasterinterface.h:494
QgsRasterInterface::sourceDataType
virtual Qgis::DataType sourceDataType(int bandNo) const
Returns source data type for the band specified by number, source data type may be shorter than dataT...
Definition: qgsrasterinterface.h:242
QgsDataProvider
Abstract base class for spatial data provider implementations.
Definition: qgsdataprovider.h:40
QgsRasterDataProvider::validateCreationOptions
virtual QString validateCreationOptions(const QStringList &createOptions, const QString &format)
Validates creation options for a specific dataset and destination format.
Definition: qgsrasterdataprovider.h:585
qgsrectangle.h
QgsRasterDataProvider::getLegendGraphic
virtual QImage getLegendGraphic(double scale=0, bool forceRefresh=false, const QgsRectangle *visibleExtent=nullptr)
Returns the legend rendered as pixmap.
Definition: qgsrasterdataprovider.h:286
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
QgsRasterDataProvider::dpi
int dpi() const
Returns the dpi of the output device.
Definition: qgsrasterdataprovider.h:450
QgsRasterDataProvider::subLayers
QStringList subLayers() const override
Returns the sublayers of this layer - useful for providers that manage their own layers,...
Definition: qgsrasterdataprovider.h:264
QgsRasterDataProvider::VirtualRasterInputLayers
Struct that stores information of the raster used in QgsVirtualRasterProvider for the calculations,...
Definition: qgsrasterdataprovider.h:543
QgsRasterDataProvider::useSourceNoDataValue
virtual bool useSourceNoDataValue(int bandNo) const
Returns the source nodata value usage.
Definition: qgsrasterdataprovider.h:244
QgsRaster::AlphaBand
@ AlphaBand
Alpha (0=transparent, 255=opaque)
Definition: qgsraster.h:69
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsRasterDataProvider::write
virtual bool write(void *data, int band, int width, int height, int xOffset, int yOffset)
Writes into the provider datasource.
Definition: qgsrasterdataprovider.h:484
QgsRaster::RasterPyramidsFormat
RasterPyramidsFormat
Definition: qgsraster.h:94
QgsRasterDataProvider::dataTimestamp
QDateTime dataTimestamp() const override
Current time stamp of data source.
Definition: qgsrasterdataprovider.h:459
QgsRaster::GreenBand
@ GreenBand
Green band of RGBA image.
Definition: qgsraster.h:67
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:44
QgsRasterDataProvider::mSrcHasNoDataValue
QList< bool > mSrcHasNoDataValue
Source no data value exists.
Definition: qgsrasterdataprovider.h:790
Qgis::DataType
DataType
Raster data types.
Definition: qgis.h:128
QgsRaster::LightnessBand
@ LightnessBand
Lightness band of HLS image.
Definition: qgsraster.h:72
QgsRasterDataProvider::VirtualRasterParameters
Struct that stores the information about the parameters that should be given to the QgsVirtualRasterP...
Definition: qgsrasterdataprovider.h:555
qgscolorrampshader.h
QgsRasterDataProvider::reload
virtual bool reload()
Reload data (data could change)
Definition: qgsrasterdataprovider.h:219
QgsRasterDataProvider::setEditable
virtual bool setEditable(bool enabled)
Turns on/off editing mode of the provider.
Definition: qgsrasterdataprovider.h:479
QgsImageFetcher::QgsImageFetcher
QgsImageFetcher(QObject *parent=nullptr)
Constructor.
Definition: qgsrasterdataprovider.h:62
QgsRasterDataProvider::bandOffset
virtual double bandOffset(int bandNo) const
Read band offset for raster value.
Definition: qgsrasterdataprovider.h:233
QgsRasterDataProvider::enableProviderResampling
virtual bool enableProviderResampling(bool enable)
Enable or disable provider-level resampling.
Definition: qgsrasterdataprovider.h:664
QgsRaster::BlueBand
@ BlueBand
Blue band of RGBA image.
Definition: qgsraster.h:68
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
qgsrasterdataprovidertemporalcapabilities.h
QgsRasterDataProvider::mUserNoDataValue
QList< QgsRasterRangeList > mUserNoDataValue
List of lists of user defined additional no data values for each band, indexed from 0.
Definition: qgsrasterdataprovider.h:803
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRasterDataProvider::setZoomedInResamplingMethod
virtual bool setZoomedInResamplingMethod(ResamplingMethod method)
Set resampling method to apply for zoomed-in operations.
Definition: qgsrasterdataprovider.h:702
qgsrasteriterator.h
QgsRasterDataProvider::setInput
bool setInput(QgsRasterInterface *input) override
Set input.
Definition: qgsrasterdataprovider.h:135
QgsRaster::UndefinedColorInterpretation
@ UndefinedColorInterpretation
Definition: qgsraster.h:63
QgsRasterDataProvider::ResamplingMethod
ResamplingMethod
Resampling method for provider-level resampling.
Definition: qgsrasterdataprovider.h:684
qgsrasterinterface.h
QgsRasterDataProvider::stepHeight
virtual int stepHeight() const
Step height for raster iterations.
Definition: qgsrasterdataprovider.h:613
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsDataProvider::mTimestamp
QDateTime mTimestamp
Timestamp of data in the moment when the data were loaded by provider.
Definition: qgsdataprovider.h:653
qgsraster.h
QgsRasterDataProvider::TransformLayerToImage
@ TransformLayerToImage
Transforms layer (georeferenced) coordinates to image coordinates.
Definition: qgsrasterdataprovider.h:640
QgsRasterDataProvider::validatePyramidsConfigOptions
virtual QString validatePyramidsConfigOptions(QgsRaster::RasterPyramidsFormat pyramidsFormat, const QStringList &configOptions, const QString &fileFormat)
Validates pyramid creation options for a specific dataset and destination format.
Definition: qgsrasterdataprovider.h:592
QgsRasterDataProvider::remove
virtual bool remove()
Remove dataset.
Definition: qgsrasterdataprovider.h:530
QgsRaster::YCbCr_CrBand
@ YCbCr_CrBand
Cr Chroma.
Definition: qgsraster.h:79
QgsRasterIdentifyResult
Raster identify results container.
Definition: qgsrasteridentifyresult.h:30
QgsRasterInterface::dataType
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
QgsRasterDataProvider::VirtualRasterInputLayers::name
QString name
Definition: qgsrasterdataprovider.h:545
QgsRasterDataProvider::VirtualRasterParameters::width
int width
Definition: qgsrasterdataprovider.h:559
QgsRaster::YellowBand
@ YellowBand
Yellow band of CMYK image.
Definition: qgsraster.h:75
QgsRaster::CyanBand
@ CyanBand
Cyan band of CMYK image.
Definition: qgsraster.h:73
QgsRasterDataProvider::ProviderCapability
ProviderCapability
Enumeration with capabilities that raster providers might implement.
Definition: qgsrasterdataprovider.h:98
QgsRasterDataProvider::setDpi
void setDpi(int dpi)
Sets the output device resolution.
Definition: qgsrasterdataprovider.h:453
QgsRaster::SaturationBand
@ SaturationBand
Saturation band of HLS image.
Definition: qgsraster.h:71
qgis_sip.h
QgsRasterDataProvider::getLegendGraphicFetcher
virtual QgsImageFetcher * getLegendGraphicFetcher(const QgsMapSettings *mapSettings)
Returns a new image downloader for the raster legend.
Definition: qgsrasterdataprovider.h:307
QgsRasterDataProvider::stepWidth
virtual int stepWidth() const
Step width for raster iterations.
Definition: qgsrasterdataprovider.h:606
QgsRasterIterator::DEFAULT_MAXIMUM_TILE_HEIGHT
static const int DEFAULT_MAXIMUM_TILE_HEIGHT
Default maximum tile height.
Definition: qgsrasteriterator.h:170
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QgsRasterInterface::clone
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
QgsRasterDataProvider::buildPyramidList
virtual QList< QgsRasterPyramid > buildPyramidList(const QList< int > &overviewList=QList< int >())
Returns the raster layers pyramid list.
Definition: qgsrasterdataprovider.h:361
QgsRasterDataProvider::buildPyramids
virtual QString buildPyramids(const QList< QgsRasterPyramid > &pyramidList, const QString &resamplingMethod="NEAREST", QgsRaster::RasterPyramidsFormat format=QgsRaster::PyramidsGTiff, const QStringList &configOptions=QStringList(), QgsRasterBlockFeedback *feedback=nullptr)
Creates pyramid overviews.
Definition: qgsrasterdataprovider.h:329
QgsRasterDataProvider::bandScale
virtual double bandScale(int bandNo) const
Read band scale for raster value.
Definition: qgsrasterdataprovider.h:227
QgsRasterRangeList
QList< QgsRasterRange > QgsRasterRangeList
Definition: qgsrasterrange.h:26
QgsRasterDataProvider::sourceNoDataValue
virtual double sourceNoDataValue(int bandNo) const
Value representing no data value.
Definition: qgsrasterdataprovider.h:250
qgsrasterpyramid.h
QgsRasterDataProvider::colorTable
virtual QList< QgsColorRampShader::ColorRampItem > colorTable(int bandNo) const
Definition: qgsrasterdataprovider.h:257
QgsRasterInterface::readXml
virtual void readXml(const QDomElement &filterElem)
Sets base class members from xml. Usually called from create() methods of subclasses.
Definition: qgsrasterinterface.h:496
QgsRasterDataProvider::fields
virtual QgsFields fields() const
Returns the fields of the raster layer for data providers that expose them, the default implementatio...
Definition: qgsrasterdataprovider.h:147
QgsRasterDataProvider::VirtualRasterInputLayers::provider
QString provider
Definition: qgsrasterdataprovider.h:547
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsDataProvider::temporalCapabilities
virtual QgsDataProviderTemporalCapabilities * temporalCapabilities()
Returns the provider's temporal capabilities.
Definition: qgsdataprovider.cpp:35
QgsRasterDataProvider::readBlock
virtual bool readBlock(int bandNo, QgsRectangle const &viewExtent, int width, int height, void *data, QgsRasterBlockFeedback *feedback=nullptr)
Reads a block of raster data into data, using the given extent and size.
Definition: qgsrasterdataprovider.h:765
QgsRasterDataProvider::TransformType
TransformType
Types of transformation in transformCoordinates() function.
Definition: qgsrasterdataprovider.h:637
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:58
QgsRasterDataProvider::setMaxOversampling
virtual bool setMaxOversampling(double factor)
Sets maximum oversampling factor for zoomed-out operations.
Definition: qgsrasterdataprovider.h:730
QgsRasterDataProvider::timestamp
QDateTime timestamp() const override
Time stamp of data source in the moment when data/metadata were loaded by provider.
Definition: qgsrasterdataprovider.h:456
QgsRasterDataProvider::maxOversampling
double maxOversampling() const
Returns maximum oversampling factor for zoomed-out operations.
Definition: qgsrasterdataprovider.h:736
QgsRasterDataProvider::setNoDataValue
virtual bool setNoDataValue(int bandNo, double noDataValue)
Set no data value on created dataset.
Definition: qgsrasterdataprovider.h:527
QgsRaster::GrayIndex
@ GrayIndex
Greyscale.
Definition: qgsraster.h:64
QgsRasterInterface
Base class for processing filters like renderers, reprojector, resampler etc.
Definition: qgsrasterinterface.h:135
QgsRasterDataProvider::userNoDataValues
virtual QgsRasterRangeList userNoDataValues(int bandNo) const
Returns a list of user no data value ranges.
Definition: qgsrasterdataprovider.h:255
QgsRasterDataProvider::TransformImageToLayer
@ TransformImageToLayer
Transforms image coordinates to layer (georeferenced) coordinates.
Definition: qgsrasterdataprovider.h:639
QgsRasterDataProvider::VirtualRasterParameters::formula
QString formula
Definition: qgsrasterdataprovider.h:561
QgsRasterDataProvider::mUseSrcNoDataValue
QList< bool > mUseSrcNoDataValue
Use source nodata value.
Definition: qgsrasterdataprovider.h:797
QgsDataProvider::extent
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
QgsRasterDataProvider::readBlock
virtual bool readBlock(int bandNo, int xBlock, int yBlock, void *data)
Reads a block of raster data into data.
Definition: qgsrasterdataprovider.h:757
QgsRasterBlockFeedback
Feedback object tailored for raster block reading.
Definition: qgsrasterinterface.h:41
QgsRasterIterator::DEFAULT_MAXIMUM_TILE_WIDTH
static const int DEFAULT_MAXIMUM_TILE_WIDTH
Default maximum tile width.
Definition: qgsrasteriterator.h:167
QgsRaster::RedBand
@ RedBand
Red band of RGBA image.
Definition: qgsraster.h:66
QgsRasterInterface::colorInterpretationName
virtual QString colorInterpretationName(int bandNumber) const
Returns the name of the color interpretation for the specified bandNumber.
Definition: qgsrasterinterface.cpp:628
QgsRaster::YCbCr_CbBand
@ YCbCr_CbBand
Cb Chroma.
Definition: qgsraster.h:78
qgsdataprovider.h
QgsRasterDataProvider::isEditable
virtual bool isEditable() const
Checks whether the provider is in editing mode, i.e.
Definition: qgsrasterdataprovider.h:467
QgsRaster::PyramidsGTiff
@ PyramidsGTiff
Definition: qgsraster.h:96
QgsRasterDataProvider::VirtualRasterParameters::rInputLayers
QList< QgsRasterDataProvider::VirtualRasterInputLayers > rInputLayers
Definition: qgsrasterdataprovider.h:562
qgsrasterrange.h
QgsRasterDataProvider::setZoomedOutResamplingMethod
virtual bool setZoomedOutResamplingMethod(ResamplingMethod method)
Set resampling method to apply for zoomed-out operations.
Definition: qgsrasterdataprovider.h:716
QgsRasterDataProvider::VirtualRasterParameters::height
int height
Definition: qgsrasterdataprovider.h:560
QgsRasterInterface::block
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)=0
Read block of data using given extent and size.
QgsRaster::BlackBand
@ BlackBand
Black band of CMLY image.
Definition: qgsraster.h:76
QgsRasterDataProvider::mExtent
QgsRectangle mExtent
Definition: qgsrasterdataprovider.h:805
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
QgsRaster::HueBand
@ HueBand
Hue band of HLS image.
Definition: qgsraster.h:70
QgsRaster::PaletteIndex
@ PaletteIndex
Paletted (see associated color table)
Definition: qgsraster.h:65
QgsRaster::IdentifyFormat
IdentifyFormat
Definition: qgsraster.h:70
QgsRasterDataProvider::VirtualRasterParameters::extent
QgsRectangle extent
Definition: qgsrasterdataprovider.h:558
QgsRasterDataProvider::zoomedOutResamplingMethod
ResamplingMethod zoomedOutResamplingMethod() const
Returns resampling method for zoomed-out operations.
Definition: qgsrasterdataprovider.h:722
QgsRasterDataProvider
Base class for raster data providers.
Definition: qgsrasterdataprovider.h:88
QgsRasterBlock
Raster data container.
Definition: qgsrasterblock.h:36
QgsRasterDataProvider::isProviderResamplingEnabled
bool isProviderResamplingEnabled() const
Returns whether provider-level resampling is enabled.
Definition: qgsrasterdataprovider.h:678
QgsRasterDataProviderTemporalCapabilities
Implementation of data provider temporal properties for QgsRasterDataProviders.
Definition: qgsrasterdataprovidertemporalcapabilities.h:38
QgsRasterDataProvider::colorName
QString colorName(int colorInterpretation) const
Definition: qgsrasterdataprovider.h:158
QgsRasterDataProvider::VirtualRasterParameters::crs
QgsCoordinateReferenceSystem crs
Definition: qgsrasterdataprovider.h:557