Constructs an sfmesh object from its extended well-known text (EWKT) representation.
Syntax
sfmesh ST_MeshFromEWKT(text ewkt);Parameters
| Parameter | Description |
|---|---|
ewkt | The EWKT representation of the sfmesh object. |
Note: The EWKT representation of ansfmeshobject is a JSON string, not the traditionalSRID=<value>;<WKT>format used by standard geometry types. The JSON structure includes fields such asversion,srid,meshgeoms,primitives, andnodes.
Example
The following example converts an sfmesh EWKT string into an sfmesh object, then reads it back as EWKT using ST_AsEWKT to verify the round trip.
SELECT ST_AsEWKT(ST_MeshFromEWKT('{"version" : 1, "srid" : 4490, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}'));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}]}What's next
ST_AsEWKT: Converts an
sfmeshobject back to its EWKT representation. This is the inverse ofST_MeshFromEWKT.
该文章对您有帮助吗?