The functions asBinary and asHexWKB serialize a raquet value, and raquetFromBinary and raquetFromHexWKB reconstruct it. A tile carries its pixels and its QUADBIN georeferencing in one value, so it round-trips through a portable byte string with no spatial extension involved, and the hexadecimal form lets a tile column round-trip through a text-based COPY. Both output functions accept an optional endianness argument, NDR for little-endian or XDR for big-endian, defaulting to the endianness of the server.
Return the Well-Known Binary (WKB) representation of a Raquet tile
asBinary(raquet,endian text='') → bytea
SELECT length(asBinary(raquet('\x01020304'::bytea, 2, 2, 5193776270265024512, 'uint8')));
-- 31
Return the Hexadecimal Well-Known Binary (HexWKB) representation of a Raquet tile
asHexWKB(raquet,endian text='') → text
SELECT length(asHexWKB(raquet('\x01020304'::bytea, 2, 2, 5193776270265024512, 'uint8')));
-- 62
Return a Raquet tile from its Well-Known Binary (WKB) representation
raquetFromBinary(bytea) → raquet
SELECT raquetFromBinary(asBinary(raquet('\x01020304'::bytea, 2, 2, 5193776270265024512,
'uint8'))) = raquet('\x01020304'::bytea, 2, 2, 5193776270265024512, 'uint8');
-- true
Return a Raquet tile from its Hexadecimal Well-Known Binary (HexWKB) representation
raquetFromHexWKB(text) → raquet
SELECT raquetFromHexWKB(asHexWKB(raquet('\x01020304'::bytea, 2, 2, 5193776270265024512,
'uint8'))) = raquet('\x01020304'::bytea, 2, 2, 5193776270265024512, 'uint8');
-- true