Return the Well-Known Text (WKT) or the Extended Well-Known Text (EWKT) representation
asText({tpose,tposechain,tpose[],tposechain[]}) → {text,text[]}
asEWKT({tpose,tposechain,tpose[],tposechain[]}) → {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,tposechain}) → text
A chain is written as the array of its links, in the order that says in whose frame each of them is read.
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",
"end":"2001-01-01T00:00:00","lower_inc":true,"upper_inc":true},
"values":[{"position":{"lat":2,"lon":1},"yaw":0.5}],
"datetimes":["2001-01-01T00:00:00"],"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","end":"2001-01-01T00:00:00",
"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"],"interpolation":"None"} */
Return the Well-Known Binary (WKB), the Extended Well-Known Binary (EWKB), the Hexadecimal Well-Known Binary (HexWKB), or the Hexadecimal Extended Well-Known Binary (HexEWKB) representation
asBinary({tpose,tposechain},endian text='') → bytea
asEWKB({tpose,tposechain},endian text='') → bytea
asHexWKB({tpose,tposechain},endian text='') → text
asHexEWKB({tpose,tposechain},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'); -- \x0138000101000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000 SELECT asEWKB(tpose 'SRID=7844;Pose(Point(1 2),1)@2001-01-01'); -- \x01380041a41e000041a41e0000000000000000f03f000000000000004000000000...009c57d3c11c0000 SELECT asHexWKB(tpose 'Pose(Point(1 2),1)@2001-01-01'); -- 0138000101000000000000F03F0000000000000040000000000000F03F009C57D3C11C0000 SELECT asHexEWKB(tpose 'SRID=3812;Pose(Point(1 2),1)@2001-01-01'); -- 01380041E40E000041E40E0000000000000000F03F00000000000000400000000000...009C57D3C11C0000
Input from the Well-Known Text (WKT) or from the Extended Well-Known Text (EWKT) representation
tposeFromText(text) → tpose tposeFromEWKT(text) → tpose tposechainFromText(text) → tposechain
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]
SELECT asEWKT(tposechainFromText('SRID=5676;PoseChain(Pose(Point(1 1),0.5))@2001-01-01'));
-- SRID=5676;PoseChain(Pose(POINT(1 1),0.5))@2001-01-01
SELECT asEWKT(tposechainFromBinary(asBinary(tposechain
'PoseChain(Pose(Point(1 1), 0.5))@2001-01-01')));
-- PoseChain(Pose(POINT(1 1),0.5))@2001-01-01
SELECT asEWKT(tposechainFromHexEWKB(asHexEWKB(tposechain 'SRID=5676;
PoseChain(Pose(Point(1 1), 0.5))@2001-01-01')));
-- SRID=5676;PoseChain(Pose(POINT(1 1),0.5))@2001-01-01
Input from the Moving Features JSON (MF-JSON) representation
tposeFromMFJSON(text) → tpose tposechainFromMFJSON(text) → tposechain
A pose chain is written as the array of its links, so a
MovingPoseChain document holds an array of pose objects
for every instant
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 SELECT asEWKT(tposechainFromMFJSON(asMFJSON(tposechain 'SRID=3812; PoseChain(Pose(Point(1 2),0.5),Pose(Point(3 4),0.25))@2001-01-01', 3))); -- SRID=3812;PoseChain(Pose(POINT(1 2),0.5),Pose(POINT(3 4),0.25))@2001-01-01
Input from the Well-Known Binary (WKB), from the Extended Well-Known Binary (EWKB), or from the Hexadecimal Extended Well-Known Binary (HexEWKB) representation
tposeFromBinary(bytea) → tpose tposeFromEWKB(bytea) → tpose tposeFromHexEWKB(text) → tpose tposechainFromBinary(bytea) → tposechain tposechainFromHexEWKB(text) → tposechain
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