Skip to content

ST_YMax

Returns the maximum Y coordinate (latitude for geography) of a geometry or geography’s bounding box.

Usage

double ST_YMax(geom: geometry)
double ST_YMax(geog: geography)

Arguments

  • geog (geography): Input geography
  • geom (geometry): Input geometry

Description

For geography, the maximum latitude is computed considering spherical geometry (e.g., the maximum latitude of a linestring that crosses the North Pole is 90).

Examples

SELECT ST_YMax(ST_GeomFromText('LINESTRING(0 0, 5 4)'));
┌────────────────────────────────────────────────────────┐
│ st_ymax(st_geomfromtext(Utf8("LINESTRING(0 0, 5 4)"))) │
│                         float64                        │
╞════════════════════════════════════════════════════════╡
│                                                    4.0 │
└────────────────────────────────────────────────────────┘
SELECT ST_YMax(ST_GeogFromText('LINESTRING(0 0, 5 4)'));
┌────────────────────────────────────────────────────────┐
│ st_ymax(st_geogfromtext(Utf8("LINESTRING(0 0, 5 4)"))) │
│                         float64                        │
╞════════════════════════════════════════════════════════╡
│                                      4.000000000000026 │
└────────────────────────────────────────────────────────┘