- Categories:
ST_XMAX¶
Returns the maximum longitude (X coordinate) of all points contained in its argument.
Syntax¶
ST_XMAX( <geography_expression> )
Arguments¶
geography_expression
The argument must be an expression of type GEOGRAPHY.
Returns¶
Returns a REAL value.
Examples¶
This shows a simple use of the ST_XMIN, ST_XMAX, ST_YMIN, and ST_YMAX functions:
CREATE or replace TABLE extreme_point_collection (g GEOGRAPHY); INSERT INTO extreme_point_collection (g) SELECT TO_GEOGRAPHY('LINESTRING(-180.0 -90.0, -179.9 -89.9, 0 0, +179.9 +89.9, +180.0 +90.0)');SELECT ST_XMIN(g), ST_XMAX(g), ST_YMIN(g), ST_YMAX(g) FROM extreme_point_collection; +------------+------------+------------+------------+ | ST_XMIN(G) | ST_XMAX(G) | ST_YMIN(G) | ST_YMAX(G) | |------------+------------+------------+------------| | -180 | 180 | -90 | 90 | +------------+------------+------------+------------+