重要

Translation is a community effort you can join. This page is currently translated at 46.15%.

28.1.26. Vector Tiles

28.1.26.1. Download vector tiles

NEW in 3.32

Downloads vector tiles of an input vector tile layer and saves them in a local vector tile file.

参数

标注

名称

类型

描述

输入图层

INPUT

[vector tiles]

A vector tile layer to extract some tiles from

Extent

EXTENT

[范围]

Specify the spatial extent of the downloaded area. It will internally be extended to a multiple of the tile size.

Available methods are:

  • Calculate from layer…: uses extent of a layer loaded in the current project

  • Calculate from layout map…: uses extent of a layout map item in the active project

  • Calculate from bookmark…: uses extent of a saved bookmark

  • Use map canvas extent

  • Draw on canvas: click and drag a rectangle delimiting the area to take into account

  • Enter the coordinates as xmin, xmax, ymin, ymax

Maximum zoom level to download

MAX_ZOOM

[数字]

Default: 10

Defines how far to zoom in and fetch data from the tiles

Tile limit

TILE_LIMIT

[数字]

Default: 100

Maximum number of tiles to download, considering the zoom levels and the extent.

Output

OUTPUT

[vector tiles]

Default: [Save to temporary file]

Specification of the output vector tile file. One of:

  • 保存到临时文件

  • 保存到文件…

输出

标注

名称

类型

描述

Output

OUTPUT

[vector tiles]

A local vector tile file storing the downloaded tiles.

Python代码

Algorithm ID: native:downloadvectortiles

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

当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。

28.1.26.2. Write vector tiles (MBTiles)

Exports one or more vector layers to vector tiles, a data format optimized for fast map rendering and small data size.

MBTiles is a specification for storing tiled map data in SQLite databases for immediate usage and for transfer. MBTiles files are known as tilesets.

参数

标注

名称

类型

描述

Input layers

INPUT

[vector: any] [list]

A list of layers to combine to generate the vector tiles

Minimum zoom level

MIN_ZOOM

[数字]

Default: 0

The lowest zoom level for which the tileset provides data. Set between 0 and 24.

Maximum zoom level

MAX_ZOOM

[数字]

Default: 3

The highest zoom level for which the tileset provides data. Set between 0 and 24.

Extent

可选

EXTENT

[范围]

Default: Not set

The maximum extent of the rendered map area. Bounds must define an area covered by all zoom levels.

Metadata: Name

可选

META_NAME

[string]

Name of the tileset

Metadata: Description

可选

META_DESCRIPTION

[string]

A description of the tileset's contents

Metadata: Attribution

可选

META_ATTRIBUTION

[string]

An attribution string, which explains the sources of data and/or style for the map.

Metadata: Version

可选

META_VERSION

[string]

The version of the tileset. This refers to a revision of the tileset itself, not of the MBTiles specification.

Metadata: Type

可选

META_TYPE

[string]

Type of tileset. Possible values are overlay or baselayer.

Metadata: Center

可选

META_CENTER

[string]

The center (string of comma-separated numbers: the longitude, latitude, and zoom level) of the default view of the map. Example: -122.1906,37.7599,11

Destination MBTiles

OUTPUT

[vector tiles]

Default: [Save to temporary file]

Specification of the output MBTiles file. One of:

  • 保存到临时文件

  • 保存到文件…

输出

标注

名称

类型

描述

Destination MBTiles

OUTPUT

[file]

Output vector tiles .mbtiles file.

Python代码

Algorithm ID: native:writevectortiles_mbtiles

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

当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。

28.1.26.3. Write vector tiles (XYZ)

Exports one or more vector layers to vector tiles, a data format optimized for fast map rendering and small data size.

参数

标注

名称

类型

描述

File template

XYZ_TEMPLATE

[string]

Default: '{z}/{x}/{y}.pbf'

Template to generate the vector tiles url

Input layers

INPUT

[vector: any] [list]

A list of layers to combine to generate the vector tiles

Minimum zoom level

MIN_ZOOM

[数字]

Default: 0

The lowest zoom level for which the tileset provides data. Set between 0 and 24.

Maximum zoom level

MAX_ZOOM

[数字]

Default: 3

The highest zoom level for which the tileset provides data. Set between 0 and 24.

Extent

可选

EXTENT

[范围]

Default: Not set

The maximum extent of the rendered map area. Bounds must define an area covered by all zoom levels.

Output directory

OUTPUT_DIRECTORY

[folder]

Default: [Save to temporary folder]

Specification of the output vector tiles folder. One of:

  • Save to a Temporary Directory

  • Save to Directory

输出

标注

名称

类型

描述

Output directory

OUTPUT_DIRECTORY

[folder]

A folder containing different subsets of the vector tiles files (.pbf) stored in subfolders corresponding to the zoom levels.

Python代码

Algorithm ID: native:writevectortiles_xyz

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

当你在数据处理工具箱某个算法前悬停时,算法 id 将会展现。*参数字*将会提供参数的名称与数值。参考详见`数据处理_控制台`以获取如何从Python控制台中运行数据处理算法。