This topic describes the ST_MeshFromText function. This function constructs an sfmesh object from the well-known text (WKT) representation of the sfmesh object.

Syntax

sfmesh ST_MeshFromText(text wkt);
sfmesh ST_MeshFromText(text wkt, int4 srid);

Parameters

ParameterDescription
wktThe sfmesh object in WKT representation.
sridThe spatial reference identifier.

Description

This function constructs an sfmesh object from the WKT representation of the sfmesh object.

Examples

SELECT ST_AsEWKT(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}', 4490));

------------------------------------------------------------------------------
{"version" : 1, "srid" : 4490, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}