Return the Well-Known Text (WKT) representation
asText({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)"}
Return the Extended Well-Known Text (EWKT) representation
asEWKT({tcbuffer,tcbuffer[],cbuffer[]}) → {text,text[]}
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))"}
TODO Return the Moving Features JSON representation
asMFJSON(tcbuffer,options=0,flags=0,maxdecdigits=15) → bytea
The options
argument can be used to add BBOX and/or CRS in MFJSON output:
0: means no option (default value)
1: MFJSON BBOX
2: MFJSON Short CRS (e.g., EPSG:4326)
4: MFJSON Long CRS (e.g., urn:ogc:def:crs:EPSG::4326)
The flags
argument can be used to customize the JSON output, for example, to produce an easy-to-read (for human readers) JSON output. Refer to the documentation of the json-c
library for the possible values. Typical values are as follows:
0: means no option (default value)
1: JSON_C_TO_STRING_SPACED
2: JSON_C_TO_STRING_PRETTY
The maxdecdigits
argument can be used to set the maximum number of decimal places in the output of floating point values (default 15).
SELECT asMFJSON(tcbuffer 'Cbuffer(Point(1 2),1)@2019-01-01 18:00:00.15+02'); /* {"type":"MovingPoint","coordinates":[[1,2]],"datetimes":["2019-01-01T17:00:00.15+01"], "interpolation":"None"} */ SELECT asMFJSON(tcbuffer 'SRID=4326; Point(50.813810 4.384260)@2019-01-01 18:00:00.15+02', 3, 2); /* {"type":"MovingPoint","crs":{"type":"name","properties":{"name":"EPSG:4326"}}, "stBoundedBy":{"bbox":[50.81,4.38,50.81,4.38], "period":{"begin":"2019-01-01 17:00:00.15+01","end":"2019-01-01 17:00:00.15+01"}}, "coordinates":[[50.81,4.38]],"datetimes":["2019-01-01T17:00:00.15+01"], "interpolations":"None"} */
Return the Well-Known Binary (WKB) representation
asBinary(tcbuffer,endian text='') → bytea
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
Return the Extended Well-Known Binary (EWKB) representation
asEWKB(tcbuffer,endian text='') → bytea
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 asEWKB(tcbuffer 'SRID=7844;Cbuffer(Point(1 2),1)@2001-01-01'); -- \x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000
Return the Hexadecimal Extended Well-Known Binary (EWKB) representation as text
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 asHexEWKB(tcbuffer 'SRID=3812;Cbuffer(Point(1 2),1)@2001-01-01'); -- 013A0001000000000000F03F0000000000000040000000000000F03F009C57D3C11C0000
Input a temporal point from its Well-Known Text (WKT) representation
tcbufferFromText(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]
Input a temporal point from its Extended Well-Known Text (EWKT) representation
tcbufferFromEWKT(text) → tcbuffer
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]
TODO Input a temporal point from its Moving Features JSON representation
tcbufferFromMFJSON(text) → tcbuffer
SELECT asEWKT(tcbufferFromMFJSON(text '{"type":"MovingPoint","crs":{"type":"name", "properties":{"name":"EPSG:4326"}},"coordinates":[[50.81,4.38]], "datetimes":["2019-01-01T17:00:00.15+01"],"interpolation":"None"}')); -- SRID=4326;Cbuffer(POINT(50.81 4.38),1)@2019-01-01 17:00:00.15+01
Input a temporal point from its Well-Known Binary (WKB) representation
tcbufferFromBinary(bytea) → tcbuffer
SELECT asEWKT(tcbufferFromBinary( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- Cbuffer(POINT(1 2),1)@2001-01-01
Input a temporal point from its Extended Well-Known Binary (EWKB) representation
tcbufferFromEWKB(bytea) → tcbuffer
SELECT asEWKT(tcbufferFromEWKB( '\x013a0001000000000000f03f0000000000000040000000000000f03f009c57d3c11c0000')); -- SRID=7844;Cbuffer(Point(1 1),2)@2001-01-01
Input a temporal point from its Hexadecimal Extended Well-Known Binary (HexEWKB) representation
tcbufferFromHexEWKB(text) → tcbuffer
SELECT asEWKT(tcbufferFromHexEWKB( '013A0001000000000000F03F0000000000000040000000000000F03F009C57D3C11C0000')); -- SRID=3812;Cbuffer(POINT(1 2),1)@2001-01-01