ST_AsBinary

将各种数据类型转为二进制格式。

语法

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);

参数

参数名称

描述

geom

meshgeom对象。

sfmeshObject

sfmesh对象。

material

material对象。

texture

texture对象。

endian

大小端,取值为:

  • 'NDR':little endian

  • 'XDR':big endian

描述

将各种数据类型转为二进制格式,功能等同于强制类型转换::bytea

示例

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...