Definition
ST_Raster.subset returns a subset of an ST_Raster object.
Syntax
Oracle
subset (parameter_list IN VARCHAR2) RETURN ST_RASTER subset (parameter_list IN VARCHAR2, options IN VARCHAR2) RETURN ST_RASTER
PostgreSQL
subset (raster IN ST_RASTER, parameter_list IN TEXT) RETURN ST_RASTER subset (raster IN ST_RASTER, parameter_list IN TEXT, options IN TEXT) RETURN ST_RASTER
SQL Server
subset (parameter_list IN NVARCHAR, options IN NVARCHAR) RETURN ST_RASTER
Returns
ST_Raster
Parameters
Parameter | Description |
---|---|
raster | The ST_Raster from which the subset will be generated |
parameter_list | A comma-delimited list of parameters enclosed in single quotes that may include the following parameters:
|
options | A comma-delimited list of options enclosed in single quotes that may include the following:
|
Examples
In the first example, the ST_Raster.subset function is used to create a copy of an existing ST_Raster object with a reversed band sequence.
In the second example, the output of the ST_Raster.subset function is used as a source of raster data for the ST_Raster.mosaic function. The second pyramid level is extracted from the image column of the world table using the ST_Raster.subset function, which is then mosaicked to the image column of the valley table.
Oracle
INSERT INTO VALLEY (image) SELECT t.image.subset('band=(3,2,1)') FROM VALLEY t WHERE t.image.raster_id = 2;
UPDATE VALLEY t SET image = t.image.mosaic ('select t.image.subset('level=2') FROM WORLD t', 'log=E:\log.txt');
PostgreSQL
INSERT INTO valley (image) SELECT subset(image,'band=(3,2,1)') FROM valley WHERE raster_id(image) = 2;
UPDATE valley SET image = mosaic (image,'select subset(image,'level=2') FROM world', 'log=E:\log.txt');
SQL Server
INSERT INTO valley (image) SELECT image.subset('band=(3,2,1)',NULL) FROM valley WHERE image.raster_id = 2;
UPDATE valley SET image = image.mosaic (NULL, 'select image.subset('level=2',NULL) FROM world', 'log=E:\log.txt');