ST_X is a PostGIS function that returns the X coordinate from a point geometry. Use it after selecting or transforming a point when a query needs the horizontal coordinate separately. section 10.5.1
Generate a map URL from a transformed point
Transform Tampa’s point to SRID 4326, then combine ST_X and ST_Y in an OpenStreetMap URL: WITH tampa_city_point AS ( SELECT ST_Transform(way, 4326) AS coordinate FROM florida.planet_osm_point WHERE name = 'Tampa' AND place = 'city' ) SELECT 'https://www.openstreetmap.org/?mlat=' || ST_Y(coordinate) || '&mlon=' || ST_X(coordinate) AS osm_url FROM tampa_city_point; The result places ST_Y at mlat and ST_X at mlon, producing a URL for Tampa’s center.
