Skip to content

ST_MINX, ST_MAXX, ST_MINY, ST_MAXY

The ST_MINX, ST_MAXX, ST_MINY, and ST_MAXY functions return the minimum X, maximum X, minimum Y, and maximum Y coordinates of a GEOGRAPHY object, respectively. These values define the bounding box of the geometry.

See also:

Syntax

sql
ST_MINX(<input>)
ST_MAXX(<input>)
ST_MINY(<input>)
ST_MAXY(<input>)

Arguments

  • <input>: The GEOGRAPHY object.

Returns

Returns a FLOAT8 value representing the requested coordinate.

Example

sql
SELECT ST_XMIN('LINESTRING(1 2, 3 4)'::GEOGRAPHY);
-- 1.0
SELECT ST_XMAX('LINESTRING(1 2, 3 4)'::GEOGRAPHY);
-- 3.0
SELECT ST_YMIN('LINESTRING(1 2, 3 4)'::GEOGRAPHY);
-- 2.0
SELECT ST_YMAX('LINESTRING(1 2, 3 4)'::GEOGRAPHY);
-- 4.0