Class: QgsRelief¶
Produces colored relief rasters from DEM.
List of all members, including inherited members
Constructor
Enums
Calculation results. |
Methods
Adds a relief color. |
|
Calculates class breaks according with the method of Buenzli (2011) using an iterative algorithm for segmented regression. |
|
Clears all existing relief colors. |
|
Writes frequency of elevation values to a file for manual inspection |
|
Starts the calculation. |
|
Returns a list of all relief colors. |
|
Sets the list of relief colors. |
|
Sets the z factor, which controls vertical elevation exaggeration. |
|
Returns the z factor, which controls vertical elevation exaggeration. |
- class qgis.analysis.QgsRelief[source]¶
Bases:
object- __init__(inputFile: str | None, outputFile: str | None, outputFormat: str | None)¶
Constructor for QgsRelief.
- ReliefColor¶
alias of
QgsRasterReliefColor
- class Result(*values)¶
Bases:
IntEnumCalculation results.
Added in version 4.2.
Success: Calculation succeededInvalidInput: Invalid input layerOutputCreationFailed: Creation of output layer failedInvalidInputSize: Input raster was too small (at least 3 rows are required)Canceled: Operation was canceled
- Canceled = 7¶
- InvalidInput = 1¶
- InvalidInputSize = 6¶
- OutputCreationFailed = 3¶
- Success = 0¶
- addReliefColorClass(self, color: QgsRasterReliefColor)[source]¶
Adds a relief
color.See also
See also
See also
- Parameters:
color (QgsRasterReliefColor)
- calculateOptimizedReliefClasses(self) list[QgsRasterReliefColor]¶
Calculates class breaks according with the method of Buenzli (2011) using an iterative algorithm for segmented regression.
- Return type:
list[QgsRasterReliefColor]
- Returns:
Truein case of success
- exportFrequencyDistributionToCsv(self, file: str | None) bool[source]¶
Writes frequency of elevation values to a
filefor manual inspection- Parameters:
file (Optional[str])
- Return type:
bool
- processRaster(self, feedback: QgsFeedback | None = None) QgsRelief.Result[source]¶
Starts the calculation.
Reads from the intput input file and stores the result in the output file.
- Parameters:
feedback (Optional[QgsFeedback] = None) – feedback object that receives update and that is checked for cancellation.
- Return type:
- Returns:
result code. Prior to QGIS 4.2 the results were returned as a raw integer value.
- reliefColors(self) list[QgsRasterReliefColor]¶
Returns a list of all relief colors.
See also
See also
See also
- Return type:
list[QgsRasterReliefColor]
- setReliefColors(self, c: Iterable[QgsRasterReliefColor])[source]¶
Sets the list of relief colors.
See also
See also
See also
- Parameters:
c (Iterable[QgsRasterReliefColor])
- setZFactor(self, factor: float)[source]¶
Sets the z
factor, which controls vertical elevation exaggeration.See also
- Parameters:
factor (float)