Introduction
Points
8. WKT for points
Linestrings
Polygons
Summary

Instruction

Great! These are our tables with points. As we already know we can change the format in which they are stored in the database to Well-Known Text using the following query:

SELECT 
  ST_AsText(coordinates) 
FROM sf_tram_stops;

The query above will show the coordinates of each tram stop in a form that we can easily read and interpret.

Exercise

Display the coordinates column of the ATM whose id is equal to 1 from the sf_atms table in a human-readable format (Well-Known Text).

The answer you get starts with the word POINT (which tells us that the geometry is a point). It is followed by parentheses, within which you will find the X and Y coordinates of the point.

Stuck? Here's a hint!

Use ST_AsText(coordinates) in your solution to convert the column to WKT.

Console

Code editor

Result

TableConsole