18#ifndef QGSRASTERLAYERUTILS_H
19#define QGSRASTERLAYERUTILS_H
30using namespace Qt::StringLiterals;
77 SIP_PYOBJECT __repr__();
79 QString str = u
"<QgsRasterReliefColor: %1-%2 (%3)>"_s.arg(
qgsDoubleToString( sipCpp->minElevation ),
qgsDoubleToString( sipCpp->maxElevation ), sipCpp->color.name() );
80 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
144 static int frequencyClassForElevation(
double elevation,
double minElevation,
double elevationClassRange );
147 static void optimiseClassBreaks( QList<int> &breaks,
double *frequencies );
155 static bool calculateRegression(
const QList<QPair<int, double>> &input,
double &a,
double &b );
RasterRangeLimit
Describes the limits used to compute raster ranges (min/max values).
QgsRange which stores a range of double values.
Base class for raster data providers.
Contains utility functions for working with raster layers.
static void computeMinMax(QgsRasterDataProvider *provider, int band, const QgsRasterMinMaxOrigin &mmo, Qgis::RasterRangeLimit limits, const QgsRectangle &extent, int sampleSize, double &min, double &max)
Compute the min max values for provider along band according to MinMaxOrigin parameters mmo and exten...
static int renderedBandForElevationAndTemporalRange(QgsRasterLayer *layer, const QgsDateTimeRange &temporalRange, const QgsDoubleRange &elevationRange, bool &matched)
Given a raster layer, returns the band which should be used for rendering the layer for a specified t...
static QList< QgsRasterReliefColor > calculateOptimizedReliefClasses(QgsRasterDataProvider *provider, int band)
Calculates optimized relief class breaks according with the method of Buenzli (2011) using an iterati...
static QgsRectangle alignRasterExtent(const QgsRectangle &extent, const QgsPointXY &origin, double pixelSizeX, double pixelSizeY)
Returns a new extent that includes the given extent with corners coordinates aligned to the pixel gri...
Represents a raster layer.
Describes the origin of minimum and maximum values in a raster.
QgsRasterReliefColor(const QColor &c, double min, double max)
Constructor for QgsRasterReliefColor.
double minElevation
Elevation range minimum.
bool operator!=(const QgsRasterReliefColor &other) const
bool operator==(const QgsRasterReliefColor &other) const
double maxElevation
Elevation range maximum.
A rectangle specified with double values.
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 c
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.