Return the Well-Known Text (WKT) or the Extended Well-Known Text (EWKT) representation
asText({tpose,tpose[]}) → {text,text[]}
asEWKT({tpose,tpose[]}) → {text,text[]}
SELECT asText(tpose 'SRID=4326;[Pose(Point(0 0),1)@2001-01-01, Pose(Point(1 1),2)@2001-01-02)'); -- [Pose(Point(0 0),1)@2001-01-01, Pose(Point(1 1),2)@2001-01-02) SELECT asText(ARRAY[pose 'Pose(Point(0 0),1)', 'Pose(Point(1 1),2)']); -- {"Pose(POINT(0 0),1)","Pose(POINT(1 1),2)"} SELECT asEWKT(tpose 'SRID=4326;[Pose(Point(0 0),1)@2001-01-01, Pose(Point(1 1),2)@2001-01-02)'); -- SRID=4326;[Pose(Point(0 0),1)@2001-01-01, Pose(Point(1 1),2)@2001-01-02) SELECT asEWKT(ARRAY[pose 'Pose(SRID=5676;Point(0 0),1)', 'Pose(SRID=5676;Point(1 1),2)']); -- {"Pose(SRID=5676;POINT(0 0),1)","Pose(SRID=5676;POINT(1 1),2))"}
Return the Moving Features JSON (MF-JSON) representation
asMFJSON(tpose) → text
SELECT asMFJSON(tpose 'Pose(Point(1 2),0.5)@2001-01-01', 3); /* {"type":"MovingPose","bbox":[[1,2],[1,2]],"period":{"begin":"2001-01-01T00:00:00+01", "end":"2001-01-01T00:00:00+01","lower_inc":true,"upper_inc":true}, "values":[{"position":{"lat":2,"lon":1},"rotation":0.5}], "datetimes":["2001-01-01T00:00:00+01"],"interpolation":"None"} */ SELECT asMFJSON(tpose 'Pose(Point Z(1 2 3),1,0,0,0)@2001-01-01', 3); /* {"type":"MovingPose","bbox":[[1,2,3],[1,2,3]], "period":{"begin":"2001-01-01T00:00:00+01","end":"2001-01-01T00:00:00+01", "lower_inc":true,"upper_inc":true}, "values":[{"position":{"lat":2,"lon":1,"h":3},"quaternion":{"x":0,"y":0,"z":0,"w":1}}], "datetimes":["2001-01-01T00:00:00+01"],"interpolation":"None"} */
Return the Well-Known Binary (WKB), the Extended Well-Known Binary (EWKB) representation, or the Hexadecimal Extended Well-Known Binary (HexEWKB) representation
asBinary(tpose,endian text='') → bytea
asEWKB(tpose,endian text='') → bytea
asHexEWKB(tpose,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(tpose 'Pose(Point(1 2),1)@2001-01-01'); -- \x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000 SELECT asEWKB(tpose 'SRID=7844;Pose(Point(1 2),1)@2001-01-01'); -- \x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000 SELECT asHexEWKB(tpose 'SRID=3812;Pose(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
tposeFromText(text) → tpose
tposeFromEWKT(text) → tpose
SELECT asEWKT(tposeFromText(text '[Pose(Point(1 2),1)@2001-01-01, Pose(Point(3 4),2)@2001-01-02]')); -- [Pose(POINT(1 2),1)@2001-01-01, Pose(POINT(3 4),2)@2001-01-02] SELECT asEWKT(tposeFromEWKT(text 'SRID=3812;[Pose(Point(1 2),1)@2001-01-01, Pose(Point(3 4),2)@2001-01-02]')); -- SRID=3812;[Pose(Point(1 2),1)@2001-01-01, Pose(Point(3 4),2)@2001-01-02]
Input from the Moving Features JSON (MF-JSON) representation
tposeFromMFJSON(bytea) → tpose
SELECT asEWKT(tposeFromMFJSON(asMFJSON(tpose 'SRID=3812;Pose(Point(1 2),0.5)@2001-01-01', 3))); -- SRID=3812;Pose(POINT(1 2),0.5)@2001-01-01 SELECT asEWKT(tposeFromMFJSON(asMFJSON(tpose 'SRID=5676;Pose(Point Z(1 2 3),1,0,0,0)@2001-01-01', 3))); -- SRID=5676;Pose(POINT Z(1 2 3),1,0,0,0)@2001-01-01
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
tposeFromBinary(bytea) → tpose
tposeFromEWKB(bytea) → tpose
tposeFromHexEWKB(text) → tpose
SELECT asEWKT(tposeFromBinary( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- Pose(POINT(1 2),1)@2001-01-01 SELECT asEWKT(tposeFromEWKB( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- SRID=7844;Pose(Point(1 1),2)@2001-01-01 SELECT asEWKT(tposeFromHexEWKB( '013A0041E40E0000E40E0000000000000000F03F...40000000000000F03F009C57D3C11C0000')); -- SRID=3812;Pose(POINT(1 2),1)@2001-01-01