QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsrasterdataprovider.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterdataprovider.cpp - 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 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "qgsproviderregistry.h"
19 #include "qgsrasterdataprovider.h"
21 #include "qgsrasterprojector.h"
22 #include "qgslogger.h"
23 
24 #include <QTime>
25 #include <QMap>
26 #include <QByteArray>
27 #include <QVariant>
28 
29 #include <qmath.h>
30 
31 #define ERR(message) QgsError(message, "Raster provider")
32 
33 void QgsRasterDataProvider::setUseSrcNoDataValue( int bandNo, bool use )
34 {
35  if ( mUseSrcNoDataValue.size() < bandNo )
36  {
37  for ( int i = mUseSrcNoDataValue.size(); i < bandNo; i++ )
38  {
39  mUseSrcNoDataValue.append( false );
40  }
41  }
42  mUseSrcNoDataValue[bandNo-1] = use;
43 }
44 
45 QgsRasterBlock * QgsRasterDataProvider::block( int theBandNo, QgsRectangle const & theExtent, int theWidth, int theHeight )
46 {
47  return block2( theBandNo, theExtent, theWidth, theHeight );
48 }
49 
50 QgsRasterBlock * QgsRasterDataProvider::block2( int theBandNo, QgsRectangle const & theExtent, int theWidth, int theHeight, QgsRasterBlockFeedback* feedback )
51 {
52  QgsDebugMsgLevel( QString( "theBandNo = %1 theWidth = %2 theHeight = %3" ).arg( theBandNo ).arg( theWidth ).arg( theHeight ), 4 );
53  QgsDebugMsgLevel( QString( "theExtent = %1" ).arg( theExtent.toString() ), 4 );
54 
56  if ( srcHasNoDataValue( theBandNo ) && useSrcNoDataValue( theBandNo ) )
57  {
58  block = new QgsRasterBlock( dataType( theBandNo ), theWidth, theHeight, srcNoDataValue( theBandNo ) );
59  }
60  else
61  {
62  block = new QgsRasterBlock( dataType( theBandNo ), theWidth, theHeight );
63  }
64 
65  if ( block->isEmpty() )
66  {
67  QgsDebugMsg( "Couldn't create raster block" );
68  return block;
69  }
70 
71  // Read necessary extent only
72  QgsRectangle tmpExtent = extent().intersect( &theExtent );
73 
74  if ( tmpExtent.isEmpty() )
75  {
76  QgsDebugMsg( "Extent outside provider extent" );
77  block->setIsNoData();
78  return block;
79  }
80 
81  double xRes = theExtent.width() / theWidth;
82  double yRes = theExtent.height() / theHeight;
83  double tmpXRes, tmpYRes;
84  double providerXRes = 0;
85  double providerYRes = 0;
86  if ( capabilities() & Size )
87  {
88  providerXRes = extent().width() / xSize();
89  providerYRes = extent().height() / ySize();
90  tmpXRes = qMax( providerXRes, xRes );
91  tmpYRes = qMax( providerYRes, yRes );
92  if ( qgsDoubleNear( tmpXRes, xRes ) ) tmpXRes = xRes;
93  if ( qgsDoubleNear( tmpYRes, yRes ) ) tmpYRes = yRes;
94  }
95  else
96  {
97  tmpXRes = xRes;
98  tmpYRes = yRes;
99  }
100 
101  if ( tmpExtent != theExtent ||
102  tmpXRes > xRes || tmpYRes > yRes )
103  {
104  // Read smaller extent or lower resolution
105 
106  if ( !extent().contains( theExtent ) )
107  {
108  QRect subRect = QgsRasterBlock::subRect( theExtent, theWidth, theHeight, extent() );
109  block->setIsNoDataExcept( subRect );
110  }
111 
112  // Calculate row/col limits (before tmpExtent is aligned)
113  int fromRow = qRound(( theExtent.yMaximum() - tmpExtent.yMaximum() ) / yRes );
114  int toRow = qRound(( theExtent.yMaximum() - tmpExtent.yMinimum() ) / yRes ) - 1;
115  int fromCol = qRound(( tmpExtent.xMinimum() - theExtent.xMinimum() ) / xRes );
116  int toCol = qRound(( tmpExtent.xMaximum() - theExtent.xMinimum() ) / xRes ) - 1;
117 
118  QgsDebugMsgLevel( QString( "fromRow = %1 toRow = %2 fromCol = %3 toCol = %4" ).arg( fromRow ).arg( toRow ).arg( fromCol ).arg( toCol ), 4 );
119 
120  if ( fromRow < 0 || fromRow >= theHeight || toRow < 0 || toRow >= theHeight ||
121  fromCol < 0 || fromCol >= theWidth || toCol < 0 || toCol >= theWidth )
122  {
123  // Should not happen
124  QgsDebugMsg( "Row or column limits out of range" );
125  return block;
126  }
127 
128  // If lower source resolution is used, the extent must beS aligned to original
129  // resolution to avoid possible shift due to resampling
130  if ( tmpXRes > xRes )
131  {
132  int col = floor(( tmpExtent.xMinimum() - extent().xMinimum() ) / providerXRes );
133  tmpExtent.setXMinimum( extent().xMinimum() + col * providerXRes );
134  col = ceil(( tmpExtent.xMaximum() - extent().xMinimum() ) / providerXRes );
135  tmpExtent.setXMaximum( extent().xMinimum() + col * providerXRes );
136  }
137  if ( tmpYRes > yRes )
138  {
139  int row = floor(( extent().yMaximum() - tmpExtent.yMaximum() ) / providerYRes );
140  tmpExtent.setYMaximum( extent().yMaximum() - row * providerYRes );
141  row = ceil(( extent().yMaximum() - tmpExtent.yMinimum() ) / providerYRes );
142  tmpExtent.setYMinimum( extent().yMaximum() - row * providerYRes );
143  }
144  int tmpWidth = qRound( tmpExtent.width() / tmpXRes );
145  int tmpHeight = qRound( tmpExtent.height() / tmpYRes );
146  tmpXRes = tmpExtent.width() / tmpWidth;
147  tmpYRes = tmpExtent.height() / tmpHeight;
148 
149  QgsDebugMsgLevel( QString( "Reading smaller block tmpWidth = %1 theHeight = %2" ).arg( tmpWidth ).arg( tmpHeight ), 4 );
150  QgsDebugMsgLevel( QString( "tmpExtent = %1" ).arg( tmpExtent.toString() ), 4 );
151 
152  QgsRasterBlock *tmpBlock;
153  if ( srcHasNoDataValue( theBandNo ) && useSrcNoDataValue( theBandNo ) )
154  {
155  tmpBlock = new QgsRasterBlock( dataType( theBandNo ), tmpWidth, tmpHeight, srcNoDataValue( theBandNo ) );
156  }
157  else
158  {
159  tmpBlock = new QgsRasterBlock( dataType( theBandNo ), tmpWidth, tmpHeight );
160  }
161 
162  readBlock( theBandNo, tmpExtent, tmpWidth, tmpHeight, tmpBlock->bits(), feedback );
163 
164  int pixelSize = dataTypeSize( theBandNo );
165 
166  double xMin = theExtent.xMinimum();
167  double yMax = theExtent.yMaximum();
168  double tmpXMin = tmpExtent.xMinimum();
169  double tmpYMax = tmpExtent.yMaximum();
170 
171  for ( int row = fromRow; row <= toRow; row++ )
172  {
173  double y = yMax - ( row + 0.5 ) * yRes;
174  int tmpRow = floor(( tmpYMax - y ) / tmpYRes );
175 
176  for ( int col = fromCol; col <= toCol; col++ )
177  {
178  double x = xMin + ( col + 0.5 ) * xRes;
179  int tmpCol = floor(( x - tmpXMin ) / tmpXRes );
180 
181  if ( tmpRow < 0 || tmpRow >= tmpHeight || tmpCol < 0 || tmpCol >= tmpWidth )
182  {
183  QgsDebugMsg( "Source row or column limits out of range" );
184  block->setIsNoData(); // so that the problem becomes obvious and fixed
185  delete tmpBlock;
186  return block;
187  }
188 
189  qgssize tmpIndex = static_cast< qgssize >( tmpRow ) * static_cast< qgssize >( tmpWidth ) + tmpCol;
190  qgssize index = row * static_cast< qgssize >( theWidth ) + col;
191 
192  char *tmpBits = tmpBlock->bits( tmpIndex );
193  char *bits = block->bits( index );
194  if ( !tmpBits )
195  {
196  QgsDebugMsg( QString( "Cannot get input block data tmpRow = %1 tmpCol = %2 tmpIndex = %3." ).arg( tmpRow ).arg( tmpCol ).arg( tmpIndex ) );
197  continue;
198  }
199  if ( !bits )
200  {
201  QgsDebugMsg( "Cannot set output block data." );
202  continue;
203  }
204  memcpy( bits, tmpBits, pixelSize );
205  }
206  }
207 
208  delete tmpBlock;
209  }
210  else
211  {
212  readBlock( theBandNo, theExtent, theWidth, theHeight, block->bits(), feedback );
213  }
214 
215  // apply scale and offset
216  block->applyScaleOffset( bandScale( theBandNo ), bandOffset( theBandNo ) );
217  // apply user no data values
218  block->applyNoDataValues( userNoDataValues( theBandNo ) );
219  return block;
220 }
221 
223  : QgsRasterInterface( nullptr )
224  , mDpi( -1 )
225 {
226 }
227 
229  : QgsDataProvider( uri )
230  , QgsRasterInterface( nullptr )
231  , mDpi( -1 )
232 {
233 }
234 
235 //
236 //Random Static convenience function
237 //
239 // convenience function for building metadata() HTML table cells
240 // convenience function for creating a string list from a C style string list
242 {
243  QStringList strings;
244 
245  // presume null terminated string list
246  for ( qgssize i = 0; stringList[i]; ++i )
247  {
248  strings.append( stringList[i] );
249  }
250 
251  return strings;
252 
253 } // cStringList2Q_
254 
256 {
257  return "<p>\n" + value + "</p>\n";
258 } // makeTableCell_
259 
260 // convenience function for building metadata() HTML table cells
262 {
263  QString s( "<tr>" );
264 
265  for ( QStringList::const_iterator i = values.begin();
266  i != values.end();
267  ++i )
268  {
270  }
271 
272  s += "</tr>";
273 
274  return s;
275 } // makeTableCell_
276 
278 {
279  QString s;
280  return s;
281 }
282 
283 // Default implementation for values
284 QgsRasterIdentifyResult QgsRasterDataProvider::identify( const QgsPoint & thePoint, QgsRaster::IdentifyFormat theFormat, const QgsRectangle &theExtent, int theWidth, int theHeight , int /*theDpi*/ )
285 {
286  QgsDebugMsgLevel( "Entered", 4 );
287  QMap<int, QVariant> results;
288 
289  if ( theFormat != QgsRaster::IdentifyFormatValue || !( capabilities() & IdentifyValue ) )
290  {
291  QgsDebugMsg( "Format not supported" );
292  return QgsRasterIdentifyResult( ERR( tr( "Format not supported" ) ) );
293  }
294 
295  if ( !extent().contains( thePoint ) )
296  {
297  // Outside the raster
298  for ( int bandNo = 1; bandNo <= bandCount(); bandNo++ )
299  {
300  results.insert( bandNo, QVariant() );
301  }
303  }
304 
305  QgsRectangle myExtent = theExtent;
306  if ( myExtent.isEmpty() ) myExtent = extent();
307 
308  if ( theWidth == 0 )
309  {
310  theWidth = capabilities() & Size ? xSize() : 1000;
311  }
312  if ( theHeight == 0 )
313  {
314  theHeight = capabilities() & Size ? ySize() : 1000;
315  }
316 
317  // Calculate the row / column where the point falls
318  double xres = ( myExtent.width() ) / theWidth;
319  double yres = ( myExtent.height() ) / theHeight;
320 
321  int col = static_cast< int >( floor(( thePoint.x() - myExtent.xMinimum() ) / xres ) );
322  int row = static_cast< int >( floor(( myExtent.yMaximum() - thePoint.y() ) / yres ) );
323 
324  double xMin = myExtent.xMinimum() + col * xres;
325  double xMax = xMin + xres;
326  double yMax = myExtent.yMaximum() - row * yres;
327  double yMin = yMax - yres;
328  QgsRectangle pixelExtent( xMin, yMin, xMax, yMax );
329 
330  for ( int i = 1; i <= bandCount(); i++ )
331  {
332  QgsRasterBlock * myBlock = block( i, pixelExtent, 1, 1 );
333 
334  if ( myBlock )
335  {
336  double value = myBlock->value( 0 );
337 
338  results.insert( i, value );
339  delete myBlock;
340  }
341  else
342  {
343  results.insert( i, QVariant() );
344  }
345  }
347 }
348 
350 {
351  return "text/plain";
352 }
353 
356 {
357  pyramidResamplingMethods_t *pPyramidResamplingMethods = reinterpret_cast< pyramidResamplingMethods_t * >( cast_to_fptr( QgsProviderRegistry::instance()->function( providerKey, "pyramidResamplingMethods" ) ) );
358  if ( pPyramidResamplingMethods )
359  {
360  QList<QPair<QString, QString> > *methods = pPyramidResamplingMethods();
361  if ( !methods )
362  {
363  QgsDebugMsg( "provider pyramidResamplingMethods returned no methods" );
364  }
365  else
366  {
367  return *methods;
368  }
369  }
370  else
371  {
372  QgsDebugMsg( "Could not resolve pyramidResamplingMethods provider library" );
373  }
375 }
376 
378 {
379  QList<QgsRasterPyramid> myPyramidList = buildPyramidList();
380 
381  if ( myPyramidList.isEmpty() )
382  return false;
383 
384  QList<QgsRasterPyramid>::iterator myRasterPyramidIterator;
385  for ( myRasterPyramidIterator = myPyramidList.begin();
386  myRasterPyramidIterator != myPyramidList.end();
387  ++myRasterPyramidIterator )
388  {
389  if ( myRasterPyramidIterator->exists )
390  {
391  return true;
392  }
393  }
394  return false;
395 }
396 
398 {
399  if ( bandNo >= mUserNoDataValue.size() )
400  {
401  for ( int i = mUserNoDataValue.size(); i < bandNo; i++ )
402  {
404  }
405  }
406  QgsDebugMsgLevel( QString( "set %1 band %1 no data ranges" ).arg( noData.size() ), 4 );
407 
408  if ( mUserNoDataValue[bandNo-1] != noData )
409  {
410  // Clear statistics
411  int i = 0;
412  while ( i < mStatistics.size() )
413  {
414  if ( mStatistics.value( i ).bandNumber == bandNo )
415  {
416  mStatistics.removeAt( i );
417  mHistograms.removeAt( i );
418  }
419  else
420  {
421  i++;
422  }
423  }
424  mUserNoDataValue[bandNo-1] = noData;
425  }
426 }
427 
429  const QString&, int,
431  int, int, double*,
433  QStringList );
434 
436  const QString &uri,
437  const QString& format, int nBands,
438  QGis::DataType type,
439  int width, int height, double* geoTransform,
441  const QStringList& createOptions )
442 {
443  createFunction_t *createFn = reinterpret_cast< createFunction_t* >( cast_to_fptr( QgsProviderRegistry::instance()->function( providerKey, "create" ) ) );
444  if ( !createFn )
445  {
446  QgsDebugMsg( "Cannot resolve 'create' function in " + providerKey + " provider" );
447  // TODO: it would be good to return invalid QgsRasterDataProvider
448  // with QgsError set, but QgsRasterDataProvider has pure virtual methods
449  return nullptr;
450  }
451  return createFn( uri, format, nBands, type, width, height, geoTransform, crs, createOptions );
452 }
453 
455 {
456  switch ( format )
457  {
459  return "Value";
461  return "Text";
463  return "Html";
465  return "Feature";
466  default:
467  return "Undefined";
468  }
469 }
470 
472 {
473  switch ( format )
474  {
476  return tr( "Value" );
478  return tr( "Text" );
480  return tr( "Html" );
482  return tr( "Feature" );
483  default:
484  return "Undefined";
485  }
486 }
487 
489 {
490  if ( formatName == "Value" ) return QgsRaster::IdentifyFormatValue;
491  if ( formatName == "Text" ) return QgsRaster::IdentifyFormatText;
492  if ( formatName == "Html" ) return QgsRaster::IdentifyFormatHtml;
493  if ( formatName == "Feature" ) return QgsRaster::IdentifyFormatFeature;
495 }
496 
498 {
499  switch ( format )
500  {
502  return IdentifyValue;
504  return IdentifyText;
506  return IdentifyHtml;
508  return IdentifyFeature;
509  default:
510  return NoCapabilities;
511  }
512 }
513 
514 bool QgsRasterDataProvider::userNoDataValuesContains( int bandNo, double value ) const
515 {
516  QgsRasterRangeList rangeList = mUserNoDataValue.value( bandNo - 1 );
517  return QgsRasterRange::contains( value, rangeList );
518 }
519 
521 {
522  mDpi = other.mDpi;
527  mExtent = other.mExtent;
528 }
529 
530 // ENDS
bool hasPyramids()
Returns true if raster has at least one populated histogram.
virtual int bandCount() const =0
Get number of bands.
virtual void readBlock(int bandNo, int xBlock, int yBlock, void *data)
Read block of data.
static unsigned index
IdentifyFormat
Definition: qgsraster.h:54
static QgsProviderRegistry * instance(const QString &pluginPath=QString::null)
Means of accessing canonical single instance.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
void copyBaseSettings(const QgsRasterDataProvider &other)
Copy member variables from other raster data provider.
static QgsRasterDataProvider * create(const QString &providerKey, const QString &uri, const QString &format, int nBands, QGis::DataType type, int width, int height, double *geoTransform, const QgsCoordinateReferenceSystem &crs, const QStringList &createOptions=QStringList())
Creates a new dataset with mDataSourceURI.
static bool contains(double value, const QgsRasterRangeList &rangeList)
Test if value is within the list of ranges.
void setXMaximum(double x)
Set the maximum x value.
Definition: qgsrectangle.h:172
#define QgsDebugMsg(str)
Definition: qgslogger.h:33
virtual QgsCoordinateReferenceSystem crs()=0
Get the QgsCoordinateReferenceSystem for this layer.
virtual double bandOffset(int bandNo) const
Read band offset for raster value.
bool userNoDataValuesContains(int bandNo, double value) const
Returns true if user no data contains value.
void applyNoDataValues(const QgsRasterRangeList &rangeList)
virtual void setUseSrcNoDataValue(int bandNo, bool use)
Set source nodata value usage.
static QString makeTableCell(const QString &value)
void removeAt(int i)
virtual int ySize() const
Capability
If you add to this, please also add to capabilitiesString()
static Capability identifyFormatToCapability(QgsRaster::IdentifyFormat format)
QgsRectangle intersect(const QgsRectangle *rect) const
return the intersection with the given rectangle
Abstract base class for spatial data provider implementations.
QString tr(const char *sourceText, const char *disambiguation, int n)
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
Definition: qgis.h:353
static QString identifyFormatName(QgsRaster::IdentifyFormat format)
int size() const
double y() const
Get the y value of the point.
Definition: qgspoint.h:193
T value(int i) const
bool setIsNoData(int row, int column)
Set no data on pixel.
virtual QString lastErrorFormat()
Returns the format of the error text for the last error in this provider.
Raster identify results container.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
virtual QgsRasterIdentifyResult identify(const QgsPoint &thePoint, QgsRaster::IdentifyFormat theFormat, const QgsRectangle &theExtent=QgsRectangle(), int theWidth=0, int theHeight=0, int theDpi=96)
Identify raster value(s) found on the point position.
void append(const T &value)
Raster data container.
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:34
bool isEmpty() const
test if rectangle is empty.
virtual QList< QgsRasterPyramid > buildPyramidList(QList< int > overviewList=QList< int >())
Accessor for ths raster layers pyramid list.
static QgsRaster::IdentifyFormat identifyFormatFromName(const QString &formatName)
virtual int capabilities() const
Returns a bitmask containing the supported capabilities.
double width() const
Width of the rectangle.
Definition: qgsrectangle.h:207
void setYMinimum(double y)
Set the minimum y value.
Definition: qgsrectangle.h:177
bool isEmpty() const
QList< QgsRasterHistogram > mHistograms
List of cached histograms, all bands mixed.
QList< bool > mSrcHasNoDataValue
Source no data value exists.
bool setIsNoDataExcept(QRect theExceptRect)
Set the whole block to no data except specified rectangle.
virtual QgsRasterBlock * block(int theBandNo, const QgsRectangle &theExtent, int theWidth, int theHeight) override
Read block of data using given extent and size.
bool isEmpty() const
Returns true if block is empty, i.e.
virtual QgsRasterBlock * block2(int theBandNo, const QgsRectangle &theExtent, int theWidth, int theHeight, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
Base class for processing filters like renderers, reprojector, resampler etc.
A class to represent a point.
Definition: qgspoint.h:117
QgsRasterDataProvider * createFunction_t(const QString &, const QString &, int, QGis::DataType, int, int, double *, const QgsCoordinateReferenceSystem &, QStringList)
virtual bool useSrcNoDataValue(int bandNo) const
Get source nodata value usage.
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:500
iterator end()
QList< double > mSrcNoDataValue
Source no data value is available and is set to be used or internal no data is available.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
Definition: qgsrectangle.h:202
static QList< QPair< QString, QString > > pyramidResamplingMethods(const QString &providerKey)
Returns a list of pyramid resampling method name and label pairs for given provider.
double xMaximum() const
Get the x maximum value (right side of rectangle)
Definition: qgsrectangle.h:187
QList< QPair< QString, QString > > * pyramidResamplingMethods_t()
virtual QgsRectangle extent() override=0
Get the extent of the data source.
virtual QGis::DataType dataType(int bandNo) const override=0
Returns data type for the band specified by number.
char * bits(int row, int column)
Get pointer to data.
QList< QgsRasterRange > QgsRasterRangeList
void applyScaleOffset(double scale, double offset)
Apply band scale and offset to raster block values @note added in 2.3.
void setYMaximum(double y)
Set the maximum y value.
Definition: qgsrectangle.h:182
virtual QString metadata()=0
Get metadata in a format suitable for feeding directly into a subset of the GUI raster properties "Me...
static QString makeTableCells(const QStringList &values)
Class for storing a coordinate reference system (CRS)
DataType
Raster data types.
Definition: qgis.h:133
double value(int row, int column) const
Read a single value if type of block is numeric.
int dataTypeSize(int bandNo)
double xMinimum() const
Get the x minimum value (left side of rectangle)
Definition: qgsrectangle.h:192
virtual QgsRasterRangeList userNoDataValues(int bandNo) const
Get list of user no data value ranges.
static QStringList cStringList2Q_(char **stringList)
double yMaximum() const
Get the y maximum value (top side of rectangle)
Definition: qgsrectangle.h:197
iterator insert(const Key &key, const T &value)
void(*)() cast_to_fptr(void *p)
Definition: qgis.h:272
virtual bool srcHasNoDataValue(int bandNo) const
Return true if source band has no data value.
QList< QgsRasterBandStats > mStatistics
List of cached statistics, all bands mixed.
virtual double srcNoDataValue(int bandNo) const
Value representing no data value.
static QRect subRect(const QgsRectangle &theExtent, int theWidth, int theHeight, const QgsRectangle &theSubExtent)
For theExtent and theWidht, theHeight find rectangle covered by subextent.
virtual void setUserNoDataValue(int bandNo, const QgsRasterRangeList &noData)
Feedback object tailored for raster block reading.
static QString identifyFormatLabel(QgsRaster::IdentifyFormat format)
virtual int xSize() const
Get raster size.
iterator begin()
#define ERR(message)
double x() const
Get the x value of the point.
Definition: qgspoint.h:185
void setXMinimum(double x)
Set the minimum x value.
Definition: qgsrectangle.h:167
double height() const
Height of the rectangle.
Definition: qgsrectangle.h:212
Base class for raster data providers.
QList< QgsRasterRangeList > mUserNoDataValue
List of lists of user defined additional no data values for each band, indexed from 0...
QList< bool > mUseSrcNoDataValue
Use source nodata value.
virtual double bandScale(int bandNo) const
Read band scale for raster value.