liveBook · Manning

ST_Y

As explained in Just Use Postgres!

ST_Y is a PostGIS function that returns the Y coordinate of a point geometry.

ST_Y is a PostGIS function that returns the Y coordinate of a point geometry. Together with ST_X, it extracts coordinates for queries and downstream formatting. section 10.5.1

Generate an OpenStreetMap URL

WITH tampa_city_point AS (\n SELECT ST_Transform(way, 4326) AS coordinate\n FROM florida.planet_osm_point\n WHERE name = 'Tampa' AND place = 'city'\n)\nSELECT 'https://www.openstreetmap.org/?mlat=' ||\n ST_Y(coordinate) || '&mlon=' || ST_X(coordinate) AS osm_url\nFROM tampa_city_point;\n\nResult: https://www.openstreetmap.org/?mlat=27.947759499952074&mlon=-82.458444

How Just Use Postgres! covers it

How deep it goes
Defines coordinate extraction and demonstrates it in one runnable query, without detailing function internals or edge cases.
Examples
Uses Tampa’s city-center point to build an OpenStreetMap URL containing latitude from ST_Y and longitude from ST_X.
What it assumes
Assumes familiarity with PostGIS point geometries, SQL queries, and coordinate transformations.
What you can do after
Apply it via PostGIS to extract Y coordinates and insert them into formatted query results or URLs.
How it connects
Connects ST_Y with point geometries, ST_X, ST_Transform, coordinate reference systems, and latitude-longitude output.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.