ST_AsBinary

更新时间:
复制 MD 格式

Returns the binary representation of an object as a bytea value.

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

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
materialThe material object.
textureThe texture object.
endianThe byte order of the output. Valid values: NDR (little-endian) and XDR (big-endian).

Description

ST_AsBinary converts an object of any supported type to its binary representation. The result is equivalent to an explicit type conversion using ::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...