QGIS API Documentation 4.3.0-Master (7c7bd4d7018)
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.
bool exportFrequencyDistributionToCsv (const QString &file)
 Writes frequency of elevation values to a file for manual inspection.
QgsReliefoperator= (const QgsRelief &rh)=delete
QgsRelief::Result processRaster (QgsFeedback *feedback=nullptr)
 Starts the calculation.
QList< QgsRasterReliefColorreliefColors () const
 Returns a list of all relief colors.
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 525 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.

◆ exportFrequencyDistributionToCsv()

bool QgsRelief::exportFrequencyDistributionToCsv ( const QString & file)

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

Definition at line 447 of file qgsrelief.cpp.

◆ operator=()

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

◆ 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.

◆ 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: