Has X/Z/T dimension?
hasX(box) → boolean
hasZ(stbox) → boolean
hasT(box) → boolean
SELECT hasX(tbox 'TBOX T([2001-01-01,2001-01-03))'); -- false SELECT hasX(stbox 'STBOX X((1.0,2.0),(3.0,4.0))'); -- true SELECT hasZ(stbox 'STBOX X((1.0,2.0),(3.0,4.0))'); -- false SELECT hasT(tbox 'TBOXFLOAT XT((1.0,3.0),[2001-01-01,2001-01-03])'); -- true SELECT hasT(stbox 'STBOX X((1.0,2.0),(3.0,4.0))'); -- false
Is geodetic?
isGeodetic(stbox) → boolean
SELECT isGeodetic(stbox 'GEODSTBOX Z((1.0,1.0,0.0),(3.0,3.0,1.0))'); -- true SELECT isGeodetic(stbox 'STBOX XT(((1.0,2.0),(3.0,4.0)),[2001-01-01,2001-01-02])'); -- false
Return the minimum X/Y/Z/T value
xMin(box) → float
yMin(stbox) → float
zMin(stbox) → float
tMin(box) → timestamptz
SELECT xMin(tbox 'TBOXFLOAT XT((1.0,3.0),[2001-01-01,2001-01-03))'); -- 1 SELECT yMin(stbox 'STBOX X((1.0,2.0),(3.0,4.0))'); -- 2 SELECT zMin(stbox 'STBOX Z((1.0,2.0,3.0),(4.0,5.0,6.0))'); -- 3 SELECT tMin(stbox 'GEODSTBOX T([2001-01-01,2001-01-03))'); -- 2001-01-01
Notice that for tbox
the result value for xMin
and xMin
is converted to a float
for the temporal boxes with an integer span.
Return the maximum X/Y/Z/T value
xMax(box) → float
yMax(stbox) → float
zMax(stbox) → float
tMax(box) → timestamptz
SELECT xMax(tbox 'TBOXINT X([1,4))'); -- 3 SELECT yMax(stbox 'STBOX X((1.0,2.0),(3.0,4.0))'); -- 4 SELECT zMax(stbox 'STBOX Z((1.0,2.0,3.0),(4.0,5.0,6.0))'); -- 6 SELECT tMax(stbox 'GEODSTBOX T([2001-01-01,2001-01-03))'); -- 2001-01-03
Notice that for tbox
the result value for xMin
and xMin
is converted to a float
for the temporal boxes with an integer span.
Is the minimum X/T value inclusive?
xMinInc(tbox) → bool
tMinInc(box) → bool
SELECT xMinInc(tbox 'TBOXFLOAT XT((1.0,3.0),[2001-01-01,2001-01-03))'); -- false SELECT tMinInc(stbox 'GEODSTBOX T([2001-01-01,2001-01-03))'); -- true
Is the maximum X/T value inclusive?
xMaxInc(tbox) → bool
tMaxInc(box) → bool
SELECT xMaxInc(tbox 'TBOXFLOAT XT((1.0,3.0),[2001-01-01,2001-01-03))'); -- false SELECT tMaxInc(stbox 'GEODSTBOX T([2001-01-01,2001-01-03))'); -- true
Area, volume, perimeter
area(stbox, spheroid bool=true) → float
volume(stbox) → float
perimeter(stbox, spheroid bool=true) → float
For geodetic boxes, the computation is done on the WGS 84 spheroid by default. If the last argument is false, a faster spherical calculation is used. The volume
function do not accept geodetic boxes.
SELECT area(stbox 'STBOX XT(((1,1),(3,3)),[2001-01-01,2001-01-03))'); -- 4 SELECT volume(stbox 'STBOX ZT(((1,1,1),(3,3,3)),[2001-01-01,2001-01-03))'); -- 8 SELECT perimeter(stbox 'STBOX XT(((1,1),(3,3)),[2001-01-01,2001-01-03))'); -- 8 SELECT area(stbox 'GEODSTBOX XT(((1,1),(3,3)),[2001-01-01,2001-01-03))'); -- 49209676328.36632 SELECT perimeter(stbox 'GEODSTBOX XT(((1,1),(3,3)),[2001-01-01,2001-01-03))', false); -- 889221.9544681838