ST_AsText()

ST_AsText renders a geometry as canonical WKT text.

Syntax

ST_AsText(geom)

Aliases: ST_AsWKT().

Arguments

Argument

Description

geom

GEOMETRY or GEOMETRY32.

Return Value

Returns a VARCHAR value.

Usage Notes

Examples

DROP DATABASE IF EXISTS geo_io_example;
CREATE DATABASE geo_io_example;
USE geo_io_example;

SELECT ST_AsText(ST_GeomFromText('POINT(1 2)')) AS wkt;

DROP DATABASE geo_io_example;

See Also

ST_GeomFromText(), ST_AsWKB().