Name

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

Synopsis

bytea ST_AsBinary(raster rast, boolean outasin=FALSE);

Description

Returns the Binary representation of the raster. If outasin is TRUE, out-db bands are treated as in-db.

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

[Note]

By default, WKB output contains the external file path for out-db bands. If the client does not have access to the raster file underlying an out-db band, set outasin to TRUE.

Enhanced: 2.1.0 Addition of outasin

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