Categories:

Geospatial Functions

ST_YMIN

Returns the minimum latitude (Y coordinate) of all points contained in the specified GEOGRAPHY object.

Syntax

ST_YMIN( <geography_expression> )

Arguments

geography_expression

The argument must be an expression of type GEOGRAPHY.

Returns

Returns a REAL value.

Usage Notes

  • The function takes into account the curvature of the edges toward the poles.

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(column1) FROM VALUES
        ('POINT(-180 0)'),
        ('POINT(180 0)'),
        ('LINESTRING(-179 0, 179 0)'),
        ('LINESTRING(-60 30, 60 30)'),
        ('LINESTRING(-60 -30, 60 -30)');
SELECT
    g,
    ST_XMIN(g),
    ST_XMAX(g),
    ST_YMIN(g),
    ST_YMAX(g)
  FROM extreme_point_collection;
+----------------------------+------------+------------+-------------------+-------------------+
| G                          | ST_XMIN(G) | ST_XMAX(G) |        ST_YMIN(G) |        ST_YMAX(G) |
|----------------------------+------------+------------+-------------------+-------------------|
| POINT(-180 0)              |       -180 |        180 |   0               |   0               |
| POINT(180 0)               |       -180 |        180 |   0               |   0               |
| LINESTRING(-179 0,179 0)   |       -180 |        180 |  -6.883275617e-14 |   6.883275617e-14 |
| LINESTRING(-60 30,60 30)   |        -60 |         60 |  30               |  49.106605351     |
| LINESTRING(-60 -30,60 -30) |        -60 |         60 | -49.106605351     | -30               |
+----------------------------+------------+------------+-------------------+-------------------+