QGIS API Documentation 3.99.0-Master (a8f284845db)
Loading...
Searching...
No Matches
QgsRasterLayerUtils Class Reference

Contains utility functions for working with raster layers. More...

#include <qgsrasterlayerutils.h>

Static Public Member Functions

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 grid defined by the origin and pixelSizeX and pixelSizeY arguments.
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 extent.
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 temporal and elevation range, respecting any elevation and temporal settings which affect the rendered band.

Detailed Description

Contains utility functions for working with raster layers.

Since
QGIS 3.38

Definition at line 38 of file qgsrasterlayerutils.h.

Member Function Documentation

◆ alignRasterExtent()

QgsRectangle QgsRasterLayerUtils::alignRasterExtent ( const QgsRectangle & extent,
const QgsPointXY & origin,
double pixelSizeX,
double pixelSizeY )
static

Returns a new extent that includes the given extent with corners coordinates aligned to the pixel grid defined by the origin and pixelSizeX and pixelSizeY arguments.

The resulting extent will be expanded if necessary to ensure that its corners fall on pixel boundaries defined by the origin and pixel sizes.

Returns
The aligned extent or the original extent if pixel sizes are zero (to avoid division by zero) or if the extent is empty.
Since
QGIS 4.0

Definition at line 287 of file qgsrasterlayerutils.cpp.

◆ computeMinMax()

void QgsRasterLayerUtils::computeMinMax ( QgsRasterDataProvider * provider,
int band,
const QgsRasterMinMaxOrigin & mmo,
Qgis::RasterRangeLimit limits,
const QgsRectangle & extent,
int sampleSize,
double & min,
double & max )
static

Compute the min max values for provider along band according to MinMaxOrigin parameters mmo and extent.

Since
QGIS 4.0

Definition at line 181 of file qgsrasterlayerutils.cpp.

◆ renderedBandForElevationAndTemporalRange()

int QgsRasterLayerUtils::renderedBandForElevationAndTemporalRange ( QgsRasterLayer * layer,
const QgsDateTimeRange & temporalRange,
const QgsDoubleRange & elevationRange,
bool & matched )
static

Given a raster layer, returns the band which should be used for rendering the layer for a specified temporal and elevation range, respecting any elevation and temporal settings which affect the rendered band.

Parameters
layerTarget raster layer
temporalRangetemporal range for rendering
elevationRangeelevation range for rendering
matchedwill be set to true if a band matching the temporal and elevation range was found
Returns
Matched band, or -1 if the layer does not have any elevation or temporal settings which affect the rendered band.

Definition at line 33 of file qgsrasterlayerutils.cpp.


The documentation for this class was generated from the following files: