All Products
Search
Document Center

ApsaraDB RDS:ST_GridLevelFromZ

Last Updated:Mar 28, 2026

Calculates the grid level of a geographic grid based on an altitude and precision level.

Syntax

bigint ST_GridLevelFromZ(float altitude, integer precision);

Parameters

ParameterDescription
altitudeThe altitude in meters.
precisionThe precision level of the geographic grid. Valid values: 1 to 32.

Description

Returns the grid level of a geographic grid that corresponds to the given altitude and precision level.

Examples

SELECT ST_GridLevelFromZ(1005.8, 25);

Output:

 st_gridlevelfromz
------------------
               597