This topic describes the ST_MeshFromWKT function. This function constructs an sfmesh object from the well-known text (WKT) representation of the sfmesh object.
Syntax
sfmesh ST_MeshFromWKT(text wkt);
sfmesh ST_MeshFromWKT(text wkt, int4 srid);Parameters
| Parameter | Description |
|---|---|
| wkt | The sfmesh object in WKT representation. |
| srid | The spatial reference identifier. |
Description
This function constructs an sfmesh object from the WKT representation of the sfmesh object.
Examples
SELECT ST_AsEWKT(ST_MeshFromWKT('{"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}]} {"geometry" : "SRID=4490;MESH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3))))"}