[GIS] the difference between ST_GEOMETRY and WKT

postgispostgresqlst-geometrywell-known-text

What is the difference between ST_GEOMETRY and WKT? Is ST_GEOMETRY just a database type and WKT (well-known text) is a textual representation of the data?

Best Answer

WKT is a text interchange format (Wikipedia) (PostGIS), and if you use PostGIS, you might use it like I do occasionally in SQL queries, to get a quick non-visual check on the geometry - see the ST_AsEWKT function.

ESRI seems to use 'ST_Geometry' to be the whole class of 'Spatial SQL' concepts and functions laid out in the OGC/ISO standard, AND use it to be a geometry storage type, e.g. in contrast to their older closed SDEBINARY format. PostGIS seems to use it as a storage type, as you use functions like ST_GeomFromText to populate spatial columns from interchange formats. Though I can't say I've got a clue what the actual storage format in PostGIS is.