Functions / PostGIS / ST_YMin
PostGISBounding Box

ST_YMin

What is ST_YMin?

ST_YMin is a PostGIS accessor that returns the minimum Y (northing / latitude) coordinate of a geometry's bounding box.

SQL
1ST_YMin(geometry geom)float
2ST_YMin(box3d box)float

When would you use ST_YMin?

Use ST_YMin whenever you need the bottom edge of a geometry — filtering features below a latitude threshold, emitting WMS BBOX strings, implementing bounding-box statistics, or running sanity checks on imported data.

SQL
1SELECT ST_YMin(geom) AS ymin, ST_YMax(geom) AS ymax
2FROM country
3WHERE iso = 'PT';

FAQs

What does ST_YMin return for an empty geometry?

NULL — empty geometries have no bounding box. Handle with COALESCE or NOT ST_IsEmpty(geom).

Is the bounding box computed lazily?

No — PostGIS geometries carry a cached 2D bounding box, so ST_YMin is O(1) even on multipolygons with millions of vertices.

Is ST_YMin aware of SRID?

It returns the raw Y coordinate in the geometry's SRS. If your SRID is EPSG:4326 the value is latitude in degrees; if it is EPSG:3857 it is a northing in metres. ST_YMin does not transform.

How does it compare to ST_YMax?

They are symmetric accessors — ST_YMin returns the south/bottom edge, ST_YMax the north/top edge. Used together they fully describe the vertical extent of a geometry's bounding box.