Name

ST_AsBinary — Return the Well-Known Binary (WKB) representation of the raster without SRID meta data.

Synopsis

bytea ST_AsBinary(raster rast);

Description

Returns the Binary representation of the raster. There are 2 variants of the function. The first variant takes no endian encoding parameter and defaults to little endian. The second variant takes a second argument denoting the encoding - using little-endian ('NDR') or big-endian ('XDR') encoding.

This is useful in binary cursors to pull data out of the database without converting it to a string representation.

Examples

SELECT ST_AsBinary(rast) As rastbin
FROM dummy_rast WHERE rid=1;

					 rastbin
---------------------------------------------------------------------------------
\001\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\010@\
000\000\000\000\000\000\340?\000\000\000\000\000\000\340?\000\000\000\000\000\00
0\000\000\000\000\000\000\000\000\000\000\012\000\000\000\012\000\024\000