Returns the grid level index along the vertical axis for a given altitude, within a geographic grid at the specified precision.
Syntax
bigint ST_GridLevelFromZ(float altitude, integer precision);Parameters
| Parameter | Type | Description |
|---|---|---|
altitude | float | The altitude, in meters. |
precision | integer | The precision level of the geographic grid. Valid values: 1–32 (inclusive). |
Description
ST_GridLevelFromZ maps an altitude (in meters) to the corresponding grid level index in the vertical dimension of a GanosBase geographic grid. The returned bigint identifies the vertical position within the grid hierarchy at the given precision.
Example
The following example returns the vertical grid level for an altitude of 1005.8 meters at precision level 25.
SELECT ST_GridLevelFromZ(1005.8, 25); st_gridlevelfromz
-------------------
597