Type tbox
has several constructor functions depending on whether the value and/or the time dimensions are given. These functions have two arguments for the minimum and maximum float
values and/or two arguments for the minimum and maximum timestamptz
values.
Constructor for tbox
tbox(float,float): tbox
tboxt(timestamptz,timestamptz): tbox
tbox(float,timestamptz,float,timestamptz): tbox
-- Both value and time dimensions SELECT tbox(1.0, '2001-01-01', 2.0, '2001-01-02'); -- Only value dimension SELECT tbox(1.0, 2.0); -- Only time dimension SELECT tboxt('2001-01-01', '2001-01-02');
Type stbox
has several constructor functions depending on whether the coordinates and/or the time dimensions are given. Furthermore, the coordinates can be 2D or 3D and can be either Cartesian or geodetic. These functions have several arguments for the minimum and maximum coordinate values and/or two arguments for the minimum and maximum timestamptz
values. The SRID can be specified in an optional last argument. If not given, a value 0 (respectively 4326) is assumed by default for planar (respectively geodetic) boxes.
Constructor for stbox
stbox(float,float,float,float,integer): stbox
stbox(float,float,float,float,float,float,integer): stbox
stbox(float,float,float,timestamptz,float,float,float,timestamptz,integer): stbox
stboxt(timestamptz,timestamptz,integer): stbox
stbox(float,float,timestamptz,float,float,timestamptz,integer): stbox
stbox(geo,{timestamp,period}): stbox
-- Only value dimension with X and Y coordinates SELECT stbox(1.0, 2.0, 1.0, 2.0); -- Only value dimension with X, Y, and Z coordinates SELECT stbox(1.0, 2.0, 3.0, 1.0, 2.0, 3.0); -- Only value dimension with X, Y, and Z coordinates and SRID SELECT stbox(1.0, 2.0, 3.0, 1.0, 2.0, 3.0); -- Both value (with X and Y coordinates) and time dimensions SELECT stboxt(1.0, 2.0, '2001-01-03', 1.0, 2.0, '2001-01-03'); -- Both value (with X, Y, and Z coordinates) and time dimensions SELECT stbox(1.0, 2.0, 3.0, '2001-01-04', 1.0, 2.0, 3.0, '2001-01-04'); -- Only time dimension SELECT stboxt('2001-01-03', '2001-01-03'); -- Only value dimension with X, Y, and Z geodetic coordinates SELECT geodstbox(1.0, 2.0, 3.0, 1.0, 2.0, 3.0); -- Both value (with X, Y, and Z geodetic coordinates) and time dimensions SELECT geodstbox(1.0, 2.0, 3.0, '2001-01-04', 1.0, 2.0, 3.0, '2001-01-03'); -- Only time dimension for geodetic box SELECT geodstboxt('2001-01-03', '2001-01-03'); SELECT stbox(geometry 'Linestring(1 1 1,2 2 2)', period '[2012-01-03, 2012-01-05]'); -- "STBOX ZT((1,1,1,2012-01-03),(2,2,2,2012-01-05))" SELECT stbox(geography 'Linestring(1 1 1,2 2 2)', period '[2012-01-03, 2012-01-05]'); -- "GEODSTBOX T((0.99878198,0.017449748,0.017452406,2012-01-03), (0.99969542,0.034878239,0.034899499,2012-01-05))"