This function clips a raster object.

Syntax

bytea ST_Clip(raster raster_obj,integer pyramidLevel, box extent, BoxType boxType);
bytea ST_Clip(raster raster_obj,integer pyramidLevel, box extent, BoxType boxType, integer destSrid);

Parameters

Parameter Description
raster_obj The raster object.
pyramidLevel The pyramid level.
extent The area to be clipped, in the format of '((minX,minY),(maxX,maxY))'.
boxType The coordinate type of the area to be clipped. The value must be Raster or World. Valid values:
  • Raster: indicates pixel coordinates.
  • World: indicates world coordinates.
destSrid The spatial reference system identifier (SRID) of the output cell subset.

Description

This function returns a cell matrix of the input window size. The size cannot exceed 100 MB.

Examples

Select ST_Clip(raster_obj, 0, '((128.980,30.0),(129.0,30.2))', 'World');
Select ST_Clip(raster_obj, 0, '((128.980,30.0),(129.0,30.2))', 'World', 4326);