This topic describes the ST_AsText function. This function returns the text representation of an object of any type.

Syntax

text ST_AsText(meshgeom geom);
text ST_AsText(sfmesh sfmeshObject);
text ST_AsText(material material);
text ST_AsText(texture texture);

Parameters

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
materialThe material object.
textureThe texture object.

Description

This function returns the text representation of an object of any type. This function serves the same as the explicit type conversion ::text.

Examples

select ST_AsText(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}'));

------------------------------------------------------------------------------
{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}