Skip to content

ST_XMax

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

Usage

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

Arguments

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

Examples

SELECT ST_XMax(ST_GeomFromText('LINESTRING (0 0, 5 4)'));
┌─────────────────────────────────────────────────────────┐
│ st_xmax(st_geomfromtext(Utf8("LINESTRING (0 0, 5 4)"))) │
│                         float64                         │
╞═════════════════════════════════════════════════════════╡
│                                                     5.0 │
└─────────────────────────────────────────────────────────┘
SELECT ST_XMax(ST_GeogFromWKT('LINESTRING (0 0, 5 4)'));
┌────────────────────────────────────────────────────────┐
│ st_xmax(st_geogfromwkt(Utf8("LINESTRING (0 0, 5 4)"))) │
│                         float64                        │
╞════════════════════════════════════════════════════════╡
│                                                    5.0 │
└────────────────────────────────────────────────────────┘