ST_MeshFromWKT

更新时间:
复制 MD 格式

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

ParameterDescription
wktThe sfmesh object in WKT representation.
sridThe 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))))"}