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: ST_GEOMETRY(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 ZM((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_MinM(inza..ST_WKTToSQL('MULTIPOINT ZM(10 10 10 10, 30 30 30 30, 15 15 15 15, 20 20 20 20)'));

ST_MINM
---------
10
(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('MULTIPOINT (10 5 ,30 15, 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('MULTIPOINT (10 5, 30 15, 15 15, 20 20)'));
ST_MINY
---------
5
(1 row)
SELECT inza..ST_MinZ(inza..ST_WKTToSQL('POLYGON Z((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 ZM((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)