~=

Name

~= — Returns TRUE if A's bounding box is the same as B's.

Synopsis

boolean ~= ( raster A , raster B ) ;

Description

The ~= operator returns TRUE if the bounding box of raster A is the same as the bounding box of raster B.

[Note]

This operand will make use of any indexes that may be available on the rasters.

Availability: 2.0.0

Examples

Very useful usecase is for taking two sets of single band rasters that are of the same chunk but represent different themes and creating a multi-band raster

SELECT ST_AddBand(prec.rast, alt.rast) As new_rast
    FROM prec INNER JOIN alt ON (prec.rast ~= alt.rast);