RS_Contains¶
Returns true if the first argument’s extent contains the second.
Usage¶
boolean RS_Contains(rast: raster, geom: geometry)
boolean RS_Contains(geom: geometry, rast: raster)
boolean RS_Contains(rastA: raster, rastB: raster)
Arguments¶
- rastA (raster): Input raster
- rastB (raster): Input raster
- geom (geometry): Input geometry
- rast (raster): Input raster
Description¶
Returns true if the convex hull of the first argument completely
contains the second argument. Both rasters and geometries are accepted
in either argument position. When two rasters are provided, their convex
hulls are compared.
If the arguments have different CRSes, the geometry is transformed into the raster’s CRS before evaluating the predicate. For two rasters, the second raster’s extent is transformed into the first raster’s CRS. If the preferred transformation fails, the extent of both sides are transformed to WGS 84 as a fallback. If either argument has no CRS set, the comparison is performed directly without CRS transformation.
Examples¶
SELECT RS_Contains(RS_Example(), ST_Point(0.5, 0.5, 4326));
┌───────────────────────────────────────────────────────────────────────────┐
│ rs_contains(rs_example(),st_point(Float64(0.5),Float64(0.5),Int64(4326))) │
│ boolean │
╞═══════════════════════════════════════════════════════════════════════════╡
│ false │
└───────────────────────────────────────────────────────────────────────────┘
SELECT RS_Contains(RS_Example(), RS_Example());
┌────────────────────────────────────────┐
│ rs_contains(rs_example(),rs_example()) │
│ boolean │
╞════════════════════════════════════════╡
│ true │
└────────────────────────────────────────┘