QGIS API Documentation 4.3.0-Master (7d9941090cd)
Loading...
Searching...
No Matches
QgsRelief Class Reference

Produces colored relief rasters from DEM. More...

#include <qgsrelief.h>

Public Types

enum class  Result : int {
  Success = 0 , InvalidInput = 1 , OutputCreationFailed = 3 , InvalidInputSize = 6 ,
  Canceled = 7
}
 Calculation results. More...

Public Member Functions

 QgsRelief (const QgsRelief &rh)=delete
 QgsRelief (const QString &inputFile, const QString &outputFile, const QString &outputFormat)
 Constructor for QgsRelief.
 ~QgsRelief ()
void addReliefColorClass (const QgsRasterReliefColor &color)
 Adds a relief color.
QList< QgsRasterReliefColorcalculateOptimizedReliefClasses ()
 Calculates class breaks according with the method of Buenzli (2011) using an iterative algorithm for segmented regression.
void clearReliefColors ()
 Clears all existing relief colors.
QStringList creationOptions () const
 Returns the list of data source creation options which will be used when creating the output raster file.
bool exportFrequencyDistributionToCsv (const QString &file)
 Writes frequency of elevation values to a file for manual inspection.
QgsReliefoperator= (const QgsRelief &rh)=delete
double outputNodataValue () const
 Returns no data value used for output file.
QgsRelief::Result processRaster (QgsFeedback *feedback=nullptr)
 Starts the calculation.
QList< QgsRasterReliefColorreliefColors () const
 Returns a list of all relief colors.
void setCreationOptions (const QStringList &list)
 Sets a list of data source creation options to use when creating the output raster file.
void setOutputNodataValue (double value)
 Sets no data value for output file.
void setReliefColors (const QList< QgsRasterReliefColor > &c)
 Sets the list of relief colors.
void setZFactor (double factor)
 Sets the z factor, which controls vertical elevation exaggeration.
double zFactor () const
 Returns the z factor, which controls vertical elevation exaggeration.

Detailed Description

Produces colored relief rasters from DEM.

Definition at line 41 of file qgsrelief.h.

Member Enumeration Documentation

◆ Result

enum class QgsRelief::Result : int
strong

Calculation results.

Since
QGIS 4.2
Enumerator
Success 

Calculation succeeded.

InvalidInput 

Invalid input layer.

OutputCreationFailed 

Creation of output layer failed.

InvalidInputSize 

Input raster was too small (at least 3 rows are required).

Canceled 

Operation was canceled.

Definition at line 58 of file qgsrelief.h.

Constructor & Destructor Documentation

◆ QgsRelief() [1/2]

QgsRelief::QgsRelief ( const QString & inputFile,
const QString & outputFile,
const QString & outputFormat )

Constructor for QgsRelief.

Definition at line 41 of file qgsrelief.cpp.

◆ ~QgsRelief()

QgsRelief::~QgsRelief ( )
default

◆ QgsRelief() [2/2]

QgsRelief::QgsRelief ( const QgsRelief & rh)
delete

Member Function Documentation

◆ addReliefColorClass()

void QgsRelief::addReliefColorClass ( const QgsRasterReliefColor & color)

Adds a relief color.

See also
clearReliefColors()
reliefColors()
setReliefColors()

Definition at line 62 of file qgsrelief.cpp.

◆ calculateOptimizedReliefClasses()

QList< QgsRasterReliefColor > QgsRelief::calculateOptimizedReliefClasses ( )

Calculates class breaks according with the method of Buenzli (2011) using an iterative algorithm for segmented regression.

Returns
true in case of success

Definition at line 521 of file qgsrelief.cpp.

◆ clearReliefColors()

void QgsRelief::clearReliefColors ( )

Clears all existing relief colors.

See also
addReliefColorClass()
reliefColors()
setReliefColors()

Definition at line 57 of file qgsrelief.cpp.

◆ creationOptions()

QStringList QgsRelief::creationOptions ( ) const
inline

Returns the list of data source creation options which will be used when creating the output raster file.

See also
setCreationOptions()
Since
QGIS 4.4

Definition at line 142 of file qgsrelief.h.

◆ exportFrequencyDistributionToCsv()

bool QgsRelief::exportFrequencyDistributionToCsv ( const QString & file)

Writes frequency of elevation values to a file for manual inspection.

Definition at line 443 of file qgsrelief.cpp.

◆ operator=()

QgsRelief & QgsRelief::operator= ( const QgsRelief & rh)
delete

◆ outputNodataValue()

double QgsRelief::outputNodataValue ( ) const
inline

Returns no data value used for output file.

See also
setOutputNodataValue()
Since
QGIS 4.4

Definition at line 158 of file qgsrelief.h.

◆ processRaster()

QgsRelief::Result QgsRelief::processRaster ( QgsFeedback * feedback = nullptr)

Starts the calculation.

Reads from the intput input file and stores the result in the output file.

Parameters
feedbackfeedback object that receives update and that is checked for cancellation.
Returns
result code. Prior to QGIS 4.2 the results were returned as a raw integer value.

Definition at line 78 of file qgsrelief.cpp.

◆ reliefColors()

QList< QgsRasterReliefColor > QgsRelief::reliefColors ( ) const
inline

Returns a list of all relief colors.

See also
clearReliefColors()
addReliefColorClass()
setReliefColors()

Definition at line 117 of file qgsrelief.h.

◆ setCreationOptions()

void QgsRelief::setCreationOptions ( const QStringList & list)
inline

Sets a list of data source creation options to use when creating the output raster file.

See also
creationOptions()
Since
QGIS 4.4

Definition at line 134 of file qgsrelief.h.

◆ setOutputNodataValue()

void QgsRelief::setOutputNodataValue ( double value)
inline

Sets no data value for output file.

See also
outputNodataValue()
Since
QGIS 4.4

Definition at line 150 of file qgsrelief.h.

◆ setReliefColors()

void QgsRelief::setReliefColors ( const QList< QgsRasterReliefColor > & c)
inline

Sets the list of relief colors.

See also
clearReliefColors()
addReliefColorClass()
reliefColors()

Definition at line 126 of file qgsrelief.h.

◆ setZFactor()

void QgsRelief::setZFactor ( double factor)
inline

Sets the z factor, which controls vertical elevation exaggeration.

See also
zFactor()

Definition at line 90 of file qgsrelief.h.

◆ zFactor()

double QgsRelief::zFactor ( ) const
inline

Returns the z factor, which controls vertical elevation exaggeration.

See also
setZFactor()

Definition at line 83 of file qgsrelief.h.


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