Returns a geometry collection containing only the parts of the input geometry whose elevation (Z value) falls within the specified range.
Syntax
geometry ST_LocateBetweenElevations(geometry geomMline, float8 elevationStart, float8 elevationEnd);Description
ST_LocateBetweenElevations filters the components of a 3D geometry by elevation range. Only components whose Z coordinate is between elevationStart and elevationEnd are included in the result. Z coordinates are preserved in the output — the function does not strip the third dimension from returned geometries.
Parameters
| Parameter | Type | Description |
|---|---|---|
geomMline | geometry | The input geometry to filter. |
elevationStart | float8 | The minimum elevation. |
elevationEnd | float8 | The maximum elevation. |
Examples
The following example filters a MULTIPOINT Z geometry, returning only the points whose Z value falls between 3 and 6. The point (7 8 9) is excluded because its Z value of 9 exceeds the upper bound.
SELECT ST_AsText(ST_LocateBetweenElevations(ST_GeomFromText('MultiPoint((1 2 3),(4 5 6),(7 8 9))'),3,6));
st_astext
----------------------------
MULTIPOINT Z (1 2 3,4 5 6)
(1 row)该文章对您有帮助吗?