# 27.1.13. 栅格地形分析

## 27.1.13.1. 坡向

### 参数

`INPUT`

[栅格]

Z 因子

`Z_FACTOR`

[数字]

`OUTPUT`

[栅格]

• 保存到临时文件

• 保存到文件…

`OUTPUT`

[栅格]

### Python代码

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```

## 27.1.13.2. 山体阴影

### 参数

`INPUT`

[栅格]

Z 因子

`Z_FACTOR`

[数字]

`AZIMUTH`

[数字]

Set the horizontal angle (in degrees) of the sun (clockwise direction). Range: 0 to 360. 0 is north.

`V_ANGLE`

[数字]

默认: 40.0

Set the vertical angle (in degrees) of the sun, that is the height of the sun. Values can go from 0 (minimum elevation) to 90 (maximum elevation).

`OUTPUT`

[栅格]

Specify the output hillshade raster layer. One of:

• 保存到临时文件

• 保存到文件…

`OUTPUT`

[栅格]

### Python代码

Algorithm ID: `qgis:hillshade`

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```

## 27.1.13.3. Hypsometric curves

Calculates hypsometric curves for an input Digital Elevation Model. Curves are produced as CSV files in an output folder specified by the user.

A hypsometric curve is a cumulative histogram of elevation values in a geographical area.

You can use hypsometric curves to detect differences in the landscape due to the geomorphology of the territory.

### 参数

DEM to analyze

`INPUT_DEM`

[栅格]

Digital Terrain Model raster layer to use for calculating altitudes

Boundary layer

`BOUNDARY_LAYER`

[vector: polygon]

Polygon vector layer with boundaries of areas used to calculate hypsometric curves

Step

`STEP`

[数字]

Default: 100.0

Vertical distance between curves

Use % of area instead of absolute value

`USE_PERCENTAGE`

[boolean]

Default: False

Write area percentage to “Area” field of the CSV file instead of the absolute area

Hypsometric curves

`OUTPUT_DIRECTORY`

[folder]

Specify the output folder for the hypsometric curves. One of:

• Save to a Temporary Directory

• Save to Directory

### 输出

Hypsometric curves

`OUTPUT_DIRECTORY`

[folder]

Directory containing the files with the hypsometric curves. For each feature from the input vector layer, a CSV file with area and altitude values will be created.

The file names start with `histogram_`, followed by layer name and feature ID.

### Python代码

Algorithm ID: `qgis:hypsometriccurves`

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```

## 27.1.13.4. Relief

Creates a shaded relief layer from digital elevation data. You can specify the relief color manually, or you can let the algorithm choose automatically all the relief classes.

### 参数

`INPUT`

[栅格]

Z 因子

`Z_FACTOR`

[数字]

Generate relief classes automatically

`AUTO_COLORS`

[boolean]

Default: False

If you check this option the algorithm will create all the relief color classes automatically

Relief colors

`COLORS`

[table widget]

Use the table widget if you want to choose the relief colors manually. You can add as many color classes as you want: for each class you can choose the lower and upper bound and finally by clicking on the color row you can choose the color thanks to the color widget.

The buttons in the right side panel give you the chance to: add or remove color classes, change the order of the color classes already defined, open an existing file with color classes and save the current classes as file.

Relief

`OUTPUT`

[栅格]

Specify the output relief raster layer. One of:

• 保存到临时文件

• 保存到文件…

Frequency distribution

`FREQUENCY_DISTRIBUTION`

[table]

Default: `[Skip output]`

Specify the CSV table for the output frequency distribution. One of:

• Skip Output

• 保存到临时文件

• 保存到文件…

### 输出

Relief

`OUTPUT`

[栅格]

The output relief raster layer

Frequency distribution

`OUTPUT`

[table]

The output frequency distribution

### Python代码

Algorithm ID: `qgis:relief`

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```

## 27.1.13.5. Ruggedness index

Calculates the quantitative measurement of terrain heterogeneity described by Riley et al. (1999). It is calculated for every location, by summarizing the change in elevation within the 3x3 pixel grid.

Each pixel contains the difference in elevation from a center cell and the 8 cells surrounding it.

### 参数

`INPUT`

[栅格]

Z 因子

`Z_FACTOR`

[数字]

Vertical exaggeration. This parameter is useful when the Z units differ from the X and Y units, for example feet and meters. You can use this parameter to adjust for this. Increasing the value of this parameter will exaggerate the final result (making it look more rugged). The default is 1 (no exaggeration).

Ruggedness

`OUTPUT`

[栅格]

Specify the output ruggedness raster layer. One of:

• 保存到临时文件

• 保存到文件…

### 输出

Ruggedness

`OUTPUT`

[栅格]

The output ruggedness raster layer

### Python代码

Algorithm ID: `qgis:ruggednessindex`

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```

## 27.1.13.6. 坡度

Calculates the slope from an input raster layer. The slope is the angle of inclination of the terrain and is expressed in degrees.

### 参数

`INPUT`

[栅格]

Z 因子

`Z_FACTOR`

[数字]

Vertical exaggeration. This parameter is useful when the Z units differ from the X and Y units, for example feet and meters. You can use this parameter to adjust for this. Increasing the value of this parameter will exaggerate the final result (making it steeper). The default is 1 (no exaggeration).

Slope

`OUTPUT`

[栅格]

Specify the output slope raster layer. One of:

• 保存到临时文件

• 保存到文件…

### 输出

Slope

`OUTPUT`

[栅格]

The output slope raster layer

### Python代码

Algorithm ID: `qgis:slope`

```import processing
processing.run("algorithm_id", {parameter_dictionary})
```