Skip to content

Returns the maximum latitude (Y coordinate) of all points contained in the specified GEOMETRY object.

ST_YMAX(<geometry>)
ArgumentsDescription
<geometry>The argument must be an expression of type GEOMETRY.

Double.

SELECT
ST_YMAX(
TO_GEOMETRY(
'GEOMETRYCOLLECTION(POINT(180 50),LINESTRING(10 10,20 20,10 40),POINT EMPTY)'
)
) AS pipeline_ymax;
┌───────────────┐
│ pipeline_ymax │
├───────────────┤
50
└───────────────┘
SELECT
ST_YMAX(
TO_GEOMETRY(
'GEOMETRYCOLLECTION(POINT(40 10),LINESTRING(10 10,20 20,10 40),POLYGON((40 40,20 45,45 30,40 40)))'
)
) AS pipeline_ymax;
┌───────────────┐
│ pipeline_ymax │
├───────────────┤
45
└───────────────┘