Return the Well-Known Text (WKT) or the Extended Well-Known Text (EWKT) representation
asText({tcbuffer,tcbuffer[],cbuffer[]}) → {text,text[]}
asEWKT({tcbuffer,tcbuffer[],cbuffer[]}) → {text,text[]}
SELECT asText(tcbuffer 'SRID=4326;[Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02)'); -- [Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02) SELECT asText(ARRAY[cbuffer 'Cbuffer(Point(0 0),1)', 'Cbuffer(Point(1 1),2)']); -- {"Cbuffer(POINT(0 0),1)","Cbuffer(POINT(1 1),2)"} SELECT asEWKT(tcbuffer 'SRID=4326;[Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02)'); -- SRID=4326;[Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02) SELECT asEWKT(ARRAY[cbuffer 'Cbuffer(SRID=5676;Point(0 0),1)', 'Cbuffer(SRID=5676;Point(1 1),2)']); -- {"Cbuffer(SRID=5676;POINT(0 0),1)","Cbuffer(SRID=5676;POINT(1 1),2))"}
Return the Well-Known Binary (WKB), the Extended Well-Known Binary (EWKB) representation, or the Hexadecimal Extended Well-Known Binary (HexEWKB) representation
asBinary(tcbuffer,endian text='') → bytea
asEWKB(tcbuffer,endian text='') → bytea
asHexEWKB(tcbuffer,endian text='') → text
The result is encoded using either the little-endian (NDR) or the big-endian (XDR) encoding. If no encoding is specified, then the encoding of the machine is used.
SELECT asBinary(tcbuffer 'Cbuffer(Point(1 2),1)@2001-01-01'); -- \x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000 SELECT asEWKB(tcbuffer 'SRID=7844;Cbuffer(Point(1 2),1)@2001-01-01'); -- \x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000 SELECT asHexEWKB(tcbuffer 'SRID=3812;Cbuffer(Point(1 2),1)@2001-01-01'); -- 013A0001000000000000F03F0000000000000040000000000000F03F009C57D3C11C0000
Input from the Well-Known Text (WKT) representation or from the Extended Well-Known Text (EWKT) representation
tcbufferFromText(text) → tcbuffer
tcbufferFromEWKT(text) → tcbuffer
SELECT asEWKT(tcbufferFromText(text '[Cbuffer(Point(1 2),1)@2001-01-01, Cbuffer(Point(3 4),2)@2001-01-02]')); -- [Cbuffer(POINT(1 2),1)@2001-01-01, Cbuffer(POINT(3 4),2)@2001-01-02] SELECT asEWKT(tcbufferFromEWKT(text 'SRID=3812;[Cbuffer(Point(1 2),1)@2001-01-01, Cbuffer(Point(3 4),2)@2001-01-02]')); -- SRID=3812;[Cbuffer(Point(1 2),1)@2001-01-01, Cbuffer(Point(3 4),2)@2001-01-02]
Input from the Well-Known Binary (WKB) representation, from the Extended Well-Known Binary (EWKB) representation, or from the Hexadecimal Extended Well-Known Binary (HexEWKB) representation
tcbufferFromBinary(bytea) → tcbuffer
tcbufferFromEWKB(bytea) → tcbuffer
tcbufferFromHexEWKB(text) → tcbuffer
SELECT asEWKT(tcbufferFromBinary( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- Cbuffer(POINT(1 2),1)@2001-01-01 SELECT asEWKT(tcbufferFromEWKB( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- SRID=7844;Cbuffer(Point(1 1),2)@2001-01-01 SELECT asEWKT(tcbufferFromHexEWKB( '013A0041E40E0000E40E0000000000000000F03F...40000000000000F03F009C57D3C11C0000')); -- SRID=3812;Cbuffer(POINT(1 2),1)@2001-01-01