ST_MinX, ST_MinY, ST_MinZ, ST_MinM

Determine the minimum x, y, z, or m (measure) coordinate of a geometry or geometry collection.

There is a separate function for each coordinate:
  • ST_MinX
  • ST_MinY
  • ST_MinZ
  • ST_MinM

Syntax

ST_MinX(geo);
ST_MinY(geo);
ST_MinZ(geo);
ST_MinM(geo);
geo
The input geometry.

Type: VARCHAR(ANY)

Returns

A value of type DOUBLE that is the minimum coordinate of all the elements of the input geometry, or NULL if input geometry is empty.

Examples

SELECT inza..ST_MinM(inza..ST_WKTToSQL('POLYGON ((10 10 0 50, 10 20 1 60, 20 20 2 70, 20 15 3 80, 10 10 0 50))'));
 
ST_MinM
-------
80
(1 row)
SELECT inza..ST_MinX(inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))'));
 
ST_MinX
---------
10
(1 row)
SELECT inza..ST_MinX(inza..ST_WKTToSQL('GeometryCollection(POINT (10 10),POINT (30 30), LINESTRING (15 15, 20 20))'));
 
ST_MinX
---------
10
(1 row)
SELECT inza..ST_MinY(inza..ST_WKTToSQL('POLYGON ((10 10, 10 30, 20 20, 20 15, 10 10))'));
 
ST_MinY
---------
10
(1 row)
SELECT inza..ST_MinY(inza..ST_WKTToSQL('GeometryCollection(POINT (10 10),POINT (30 15), LINESTRING (15 15, 20 20))'));
 
ST_MinY
---------
10
(1 row)
SELECT inza..ST_MinZ(inza..ST_WKTToSQL('POLYGON ((10 10 0, 10 20 1, 20 20 2, 20 15 3, 10 10 0))'));
 
ST_MinZ
---------
0
(1 row)
SELECT inza..ST_MinZ(inza..ST_WKTToSQL('POLYGON ((10 10 10 10, 10 20 20 20, 20 20 20 20, 20 15 15 40, 10 10 10 10))'));
 
ST_MinZ
---------
10
(1 row)
SELECT inza..ST_MinZ(inza..ST_WKTToSQL('LINESTRING EMPTY')); ST_MinZ
---------
(1 row)