27.1.14. 栅格工具
27.1.14.1. 将地图转换为栅格
Creates a raster image of map canvas content.
A map theme can be selected to render a predetermined set of layers with a defined style for each layer.
Alternatively, a single layer can be selected if no map theme is set.
If neither map theme nor layer is set, the current map content will be rendered. The minimum extent entered will internally be extended to be a multiple of the tile size.
参数
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Minimum extent to render (xmin, xmax, ymin, ymax) |
|
[范围] |
Specify the extent of the output raster layer. It will internally be extended to a multiple of the tile size. Available methods are:
|
瓦片尺寸 |
|
[数字] 默认值: 1024 |
Size of the tile of the output raster layer. Minimum value: 64. |
Map units per pixel |
|
[数字] Default: 100.0 |
Pixel size (in map units). Minimum value: 0.0 |
Make background transparent |
|
[boolean] Default: False |
Allows exporting the map with a transparent background.
Outputs an RGBA (instead of RGB) image if set to |
Map theme to render 可选 |
|
[enumeration] |
Use an existing map theme for the rendering. |
Single layer to render 可选 |
|
[enumeration] |
Choose a single layer for the rendering |
Output layer |
|
[栅格] 默认: |
Specification of the output raster. One of:
|
输出
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Output layer |
|
[栅格] |
Output raster layer |
Python代码
Algorithm ID: native:rasterize
import processing
processing.run("algorithm_id", {parameter_dictionary})
当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。
27.1.14.2. Fill NoData cells
Resets the NoData values in the input raster to a chosen value, resulting in raster dataset with no NoData pixels.
The algorithm respects the input raster data type, e.g. a floating point fill value will be truncated when applied to an integer raster.
参数
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
输入栅格 |
|
[栅格] |
The raster to process. |
Band number |
|
[数字] Default: 1 |
The band of the raster |
Fill value |
|
[数字] 默认值:1.0 |
Set the value to use for the NoData pixels |
Output raster |
|
[栅格] 默认: |
Specification of the output raster. One of:
|
输出
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Output raster |
|
[栅格] |
The output raster layer with filled data cells. |
Python代码
Algorithm ID: native:fillnodata
import processing
processing.run("algorithm_id", {parameter_dictionary})
当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。
27.1.14.3. Generate XYZ tiles (Directory)
Generates raster “XYZ” tiles using the current QGIS project as individual images to a directory structure.
参数
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Extent (xmin, xmax, ymin, ymax) |
|
[范围] |
Specify the extent of the tiles. It will internally be extended to a multiple of the tile size. Available methods are:
|
Minimum zoom |
|
[数字] Default: 12 |
Minimum 0, maximum 25. |
Maximum zoom |
|
[数字] Default: 12 |
Minimum 0, maximum 25. |
DPI |
|
[数字] Default: 96 |
Minimum 48, maximum 600. |
Background color 可选 |
|
[color] Default: QColor(0, 0, 0, 0) |
Choose the background color for the tiles |
Tile format |
|
[enumeration] Default: 0 |
One of:
|
Quality (JPG only) 可选 |
|
[数字] Default: 75 |
Minimum 1, maximum 100. |
Metatile size 可选 |
|
[数字] Default: 4 |
Specify a custom metatile size when generating XYZ tiles. Larger values may speed up the rendering of tiles and provide better labelling (fewer gaps without labels) at the expense of using more memory. Minimum 1, maximum 20. |
Tile width 可选 |
|
[数字] Default: 256 |
Minimum 1, maximum 4096. |
Tile height 可选 |
|
[数字] Default: 256 |
Minimum 1, maximum 4096. |
Use inverted tile Y axis (TMS conventions) 可选 |
|
[boolean] Default: False |
|
Output directory 可选 |
|
[folder] Default: |
Specification of the output directory (for the tiles). One of:
|
Output html (Leaflet) 可选 |
|
[html] 默认: |
Specification of the output HTML file. One of:
|
输出
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Output directory |
|
[folder] |
Output directory (for the tiles) |
Output html (Leaflet) |
|
[html] |
The output HTML (Leaflet) file |
Python代码
Algorithm ID: qgis:tilesxyzdirectory
import processing
processing.run("algorithm_id", {parameter_dictionary})
当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。
27.1.14.4. Generate XYZ tiles (MBTiles)
Generates raster “XYZ” tiles using the current QGIS project as a single file in the “MBTiles” format.
参数
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Extent (xmin, xmax, ymin, ymax) |
|
[范围] |
Specify the extent of the tiles. It will internally be extended to a multiple of the tile size. Available methods are:
|
Minimum zoom |
|
[数字] Default: 12 |
Minimum 0, maximum 25. |
Maximum zoom |
|
[数字] Default: 12 |
Minimum 0, maximum 25. |
DPI |
|
[数字] Default: 96 |
Minimum 48, maximum 600. |
Background color 可选 |
|
[color] Default: QColor(0, 0, 0, 0) |
Choose the background color for the tiles |
Tile format |
|
[enumeration] Default: 0 |
One of:
|
Quality (JPG only) 可选 |
|
[数字] Default: 75 |
Minimum 1, maximum 100. |
Metatile size 可选 |
|
[数字] Default: 4 |
Specify a custom metatile size when generating XYZ tiles. Larger values may speed up the rendering of tiles and provide better labelling (fewer gaps without labels) at the expense of using more memory. Minimum 1, maximum 20. |
Output file (for MBTiles) |
|
[file] 默认: |
Specification of the output file. One of:
|
输出
标注 |
名称 |
类型 |
描述 |
---|---|---|---|
Output file (for MBTiles) |
|
[file] |
The output file. |
Python代码
Algorithm ID: qgis:tilesxyzmbtiles
import processing
processing.run("algorithm_id", {parameter_dictionary})
当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。