Constructs an sfmesh object from its well-known text (WKT) representation.
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 (SRID) to assign to the sfmesh object. |
Example
The following example constructs an sfmesh object from a WKT string and assigns SRID 4490, then returns its EWKT representation using ST_AsEWKT.
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));Output:
{"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))))"}该文章对您有帮助吗?