This topic describes the INCLUDE operators. These operators are used to check whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in a specified dimension.

Syntax

{geometry, trajectory, boxndf} /@>/ {geometry, trajectory, boxndf}
{trajectory, boxndf} #@># {trajectory, boxndf}
{geometry, trajectory, boxndf} @> {geometry, trajectory, boxndf}
{geometry, trajectory, boxndf} @/> {geometry, trajectory, boxndf}
{trajectory, boxndf} @#> {trajectory, boxndf}
{trajectory, boxndf} @/#> {trajectory, boxndf}

Parameters

Parameter Description
Left operand The object whose bounding box you want to compare.
Right operand The object whose bounding box you want to compare.

Description

The INCLUDE operators allow you to check whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in a specified dimension. These bounding boxes are generated by the ST_MakeBox function. For more information, see ST_MakeBox. The effect of the INCLUDE operators is opposite to that of the INCLUDED operators. For more information, see INCLUDED operators.

The following INCLUDE operators are supported:

  • /@>/: checks whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in the z dimension.
  • #@>#: checks whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in the t dimension.
  • @>: checks whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in the x and y dimensions.
  • @&>: checks whether the bounding box of the left operand-specified object includes the bounding box of the right operand-specified object in the x, y, and z dimensions.
  • <#@: checks whether the bounding box of the left operand-specified object is included in the bounding box of the right operand-specified object in the x, y, and t dimensions.
  • @/#>: checks whether the bounding box of the left operand-specified object is included in the bounding box of the right operand-specified object in the x, y, z, and t dimensions.

Example

WITH box AS(
    SELECT ST_MakeBox3dt(0,0,0, '2010-01-01 00:00:00',10,10,10, '2012-01-01 00:00:00') a,
           ST_MakeBox3dt(6,6,3,'2010-01-01 00:00:00',8,8,5,'2013-01-01 00:00:00') b
)
SELECT a /@>/ b AS OpZ, a #@># b AS OpT, a @> b AS Op2D, a @/> b AS Op3D, a @#> b AS Op2DT, a @/#> b AS Op3DT from box;
 opz | opt | op2d | op3d | op2dt | op3dt 
-----+-----+------+------+-------+-------
 t   | f   | t    | t    | f     | f