ST_X¶
Returns the X coordinate (longitude for geography) of the point, or NULL if not available.
Usage¶
double ST_X(geom: geometry)
double ST_X(geog: geography)
Arguments¶
- geog (geography): Input geography
- geom (geometry): Input geometry
Description¶
Returns NULL for non-point geometries or NULL input.
Examples¶
SELECT ST_X(ST_Point(-74.0060, 40.7128));
┌───────────────────────────────────────────────────┐
│ st_x(st_point(Float64(-74.006),Float64(40.7128))) │
│ float64 │
╞═══════════════════════════════════════════════════╡
│ -74.006 │
└───────────────────────────────────────────────────┘
SELECT ST_X(ST_GeogPoint(-74.0060, 40.7128));
┌───────────────────────────────────────────────────────┐
│ st_x(st_geogpoint(Float64(-74.006),Float64(40.7128))) │
│ float64 │
╞═══════════════════════════════════════════════════════╡
│ -74.006 │
└───────────────────────────────────────────────────────┘