All Products
Search
Document Center

PolarDB:ST_AsMVTGeom3D

Last Updated:Jul 27, 2023

This topic describes the ST_AsMVTGeom3D function. This function represents 3D geometries in the title coordinate system.

Syntax

geometry ST_AsMVTGeom3D(
  geometry geom, 
  box2d bounds, 
  integer extent = 4096, 
  integer buffer = 256, 
  boolean clip_geom = true
);

Parameters

Parameter

Description

geom

The 3D geometry object.

bounds

The rectangular boundaries of the tile, excluding the buffer.

extent

The size of the tile in the tile coordinate system.

Valid values: 256 to 8192. Default value: 4096.

buffer

The size of the buffer in the tile coordinate system.

Valid values: 1 to 4096. Default value: 256.

clip_geom

Specifies whether the 3D geometry object is clipped by tile boundaries. Default value: true.

Description

  • This function is used to represent 3D geometries in the title coordinate system that is required by the ST_AsMVT3D function.

  • This function is upgraded from the ST_AsMVTGeom function and can be called to transform the z-axis data of a 3D geometry.

  • This function requires tile rectangle boundaries in the required spatial coordinate so that the geometry can be transformed and clipped when necessary. You can call the ST_TileEnvelope function to generate boundaries.

  • This function cannot be called to transform 3D polygon objects that have inner shells in a 3D geometry object.

Examples

SELECT ST_AsText(ST_AsMVTGeom3D(ST_Transform('SRID=4326; LINESTRING(-10 -10 30, -10 -20 30)'::geometry, 3857), ST_TileEnvelope(1, 0, 0))) AS geom;
                                        geom                                        
------------------------------------------------------------------------------------
 MULTILINESTRING Z ((3868.44444444444 4324.7197219642 30,3868.44444444444 4352 30))
(1 row)