All Products
Search
Document Center

PolarDB:ST_GridLevelAsZ

Last Updated:Mar 28, 2026

Converts a geographic grid level into an altitude measured from the bottom of the grid.

Syntax

bigint ST_GridLevelAsZ(integer gridlevel, integer precision);

Parameters

ParameterDescription
gridlevelThe height of the geographic grid.
precisionThe precision level of the geographic grid. Valid values: 1 to 32.

Description

ST_GridLevelAsZ calculates the altitude at the bottom of a geographic grid cell, based on the grid level and precision. The result is returned as a bigint value representing the altitude.

Examples

SELECT ST_GridLevelAsZ(1, 15);

Output:

 st_gridlevelasz
------------------
 1724.595652720891