This topic describes the ST_AsBinary function. This function returns the binary representation of an object of any type.
Syntax
bytea ST_AsBinary(meshgeom geom);
bytea ST_AsBinary(sfmesh sfmeshObject);
bytea ST_AsBinary(material material);
bytea ST_AsBinary(texture texture);
bytea ST_AsBinary(meshgeom geom, cstring endian);
bytea ST_AsBinary(sfmesh sfmeshObject, cstring endian);
bytea ST_AsBinary(material material, cstring endian);
bytea ST_AsBinary(texture texture, cstring endian);Parameters
| Parameter | Description |
|---|---|
| geom | The meshgeom object. |
| sfmeshObject | The sfmesh object. |
| material | The material object. |
| texture | The texture object. |
| endian | The endian. Valid values:
|
Description
This function returns the binary representation of an object of any type. This function serves the same as the explicit type conversion ::bytea.
Examples
select ST_AsBinary(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}'));
------------------------------------------------------------------------------
\x014d0102...