Returns the grid level of a geographic grid based on the given altitude and precision.
Syntax
bigint ST_GridLevelFromZ(float altitude, integer precision)Parameters
| Parameter | Description |
|---|---|
altitude | The altitude in meters. |
precision | The precision level of the geographic grid. Valid values: 1 to 32. |
Description
ST_GridLevelFromZ computes the grid level corresponding to a given altitude at a specified precision level. The return value is a bigint representing the grid level index.
Examples
SELECT ST_GridLevelFromZ(1005.8, 25);Output:
st_gridlevelfromz
------------------
597