liveBook · Manning

Latitude

As explained in Just Use Postgres!

Latitude is the angular coordinate measuring position north or south of the equator on Earth.

Latitude measures a location’s angular position north or south of the equator. In geospatial SQL, it appears with longitude when coordinates are transformed to SRID 4326, the GPS-style Earth coordinate system. section 10.5.1

Use latitude when converting, extracting, or publishing geographic coordinates:

  • Transform geometry with ST_Transform(way, 4326) to obtain longitude and latitude. section 10.5.1
  • Extract latitude with ST_Y; longitude is extracted with ST_X. section 10.5.1
  • Pass latitude as the mlat parameter when generating an OpenStreetMap URL. section 10.5.1

Mapping Tampa’s latitude

After transforming Tampa’s point, the result is POINT(-82.458444 27.947759499952074): longitude comes first, followed by latitude. An OpenStreetMap URL uses mlat=27.947759499952074 and mlon=-82.458444 to place the marker. section 10.5.1

Listing 10.12 Transforming coordinates to latitude and longitude
SELECT name, ST_AsText(ST_Transform(way, 4326)) AS coordinates 
FROM florida.planet_osm_point
WHERE name = 'Tampa' and place = 'city';

See the executable transformation that converts a stored point into longitude-and-latitude coordinates. section 10.5.1

How Just Use Postgres! covers it

How deep it goes
Explains coordinate transformation and extraction, but stops short of mathematical treatment of angular measurement.
Examples
Demonstrates Tampa’s transformed point and an OpenStreetMap URL containing latitude and longitude parameters.
What it assumes
Assumes familiarity with geographic points and SQL queries while showing the conversion from projected coordinates.
What you can do after
Apply latitude through PostGIS transformations, coordinate extraction, and map URLs.
How it connects
Connects latitude with longitude, PostGIS points, SRID 4326, GPS, ST_Transform, ST_Y, and OpenStreetMap.

Also explained in

Compare how 2 books explain latitude →

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.