ST_{X|Y|Z|T}Min
Updated at:
Returns the minimum value of a bounding box along a specified dimension.
Syntax
float8 ST_XMin(boxndf box);
float8 ST_YMin(boxndf box);
float8 ST_ZMin(boxndf box);
timestamp ST_TMin(boxndf box);Parameters
| Parameter | Description |
|---|---|
box | The bounding box to query. |
Return values
| Function | Return type | Description |
|---|---|---|
ST_XMin | float8 | The minimum x value of the bounding box. Returns NaN if the bounding box has no x dimension. |
ST_YMin | float8 | The minimum y value of the bounding box. Returns NaN if the bounding box has no y dimension. |
ST_ZMin | float8 | The minimum z value of the bounding box. Returns NaN if the bounding box has no z dimension. |
ST_TMin | timestamp | The minimum t (time) value of the bounding box. Returns -infinity if the bounding box has no t dimension. |
Usage notes
For x, y, and z dimensions, if the bounding box does not have the specified dimension, the function returns
NaN.For the t dimension, if the bounding box does not have a t dimension, the function returns
-infinity.
Examples
Query the minimum x value of a 2D bounding box with a time range:
SELECT ST_XMin(ST_MakeBox2dt(0,0,'2000-01-01'::timestamp, 20,20, '2020-01-01'::timestamp));Result:
st_xmin
---------
0Query the minimum z value of a 2D bounding box with a time range. Because the box has no z dimension, the function returns NaN:
SELECT ST_ZMin(ST_MakeBox2dt(0,0,'2000-01-01'::timestamp, 20,20, '2020-01-01'::timestamp));Result:
st_zmin
---------
NaNQuery the minimum t value of a 2D bounding box. Because the box has no t dimension, the function returns -infinity:
SELECT ST_TMin(ST_MakeBox2d(0,0, 20,20));Result:
st_tmin
-----------
-infinityIs this page helpful?