Definition
The ST_Raster.mosaic function merges the input image or images with an existing ST_Raster object. This function is intended for UPDATE statements only. A database error will be returned when used in a SELECT statement.
The ST_Raster.mosaic function is executed within a single transaction, so consideration must be given to the number of source rasters to be mosaicked at one time, with respect to the amount of rollback space available to accommodate the pending transaction.
When source raster data is on a network drive, appropriate file access permission must be granted to the owner of the current database process.
Syntax
Oracle
mosaic (filename IN VARCHAR2) RETURN ST_RASTER mosaic (filename IN VARCHAR2, parameter_list IN VARCHAR2) RETURN ST_RASTER mosaic (data IN ST_PIXELDATA) RETURN ST_RASTER mosaic (data IN ST_PIXELDATA, parameter_list IN VARCHAR2) RETURN ST_RASTER
PostgreSQL
mosaic (raster IN ST_RASTER, filename IN TEXT) RETURN ST_RASTER mosaic (raster IN ST_RASTER, filename IN TEXT, parameter_list IN TEXT) RETURN ST_RASTER mosaic (raster IN ST_RASTER, data IN ST_PIXELDATA) RETURN ST_RASTER mosaic (raster IN ST_RASTER, data IN ST_PIXELDATA, parameter_list IN TEXT) RETURN ST_RASTER
SQL Server
mosaic (filename IN NVARCHAR, data IN ST_PIXELDATA, parameter_list IN NVARCHAR) RETURN ST_RASTER
Returns
ST_Raster
Parameters
Parameter | Description |
---|---|
filename | The file name or names of the source raster data The file name can contain operating system wildcard characters. Or it could be a SQL SELECT statement that selects a single ST_Raster column from a user-defined table. The supported image file format is GeoTIFF. |
data | A predefined ST_PixelData object |
raster | The ST_Raster target value to which the designated image is to be mosaicked |
parameter_list | A comma-delimited list of parameters enclosed in single quotes that may include the following parameters:
|
Examples
These examples illustrates the following:
- Create a mosaic of all the TIFFs under the path E:\data and all its subfolders to an existing ST_Raster object. The results of the mosaic function are written to the log file E:\'log.txt'.
- Populate an ST_PixelData object with the pixels of an ST_Raster object and then mosaic it to another ST_Raster object.
Oracle
UPDATE SAT t SET image = t.image.mosaic('E:\data\*.tif', 'recursive,log=E:\log.txt');
DECLARE data sde.ST_PIXELDATA; BEGIN SELECT t.image.getPixelData('level=1') INTO DATA FROM SAT t; UPDATE SAT t SET image = t.image.mosaic(data,'log=E:\log.txt'); END; /
PostgreSQL
UPDATE sat SET image = mosaic(image,'E:\data\*.tif', 'recursive,log=E:\log.txt');
DROP FUNCTION IF EXISTS mosaic_from_pixeldata(); CREATE OR REPLACE FUNCTION mosaic_from_pixeldata() RETURNS integer AS ' DECLARE data sde.st_pixeldata; BEGIN SELECT getPixelData(image) INTO data FROM sat; UPDATE sat SET image = mosaic(image,data,''log=E:\log.txt'') WHERE name = ''1_1_data''; END;' LANGUAGE plpgsql; SELECT mosaic_from_pixeldata(); DROP FUNCTION IF EXISTS mosaic_from_pixeldata();
SQL Server
UPDATE sat SET image = image.mosaic('E:\data\*.tif',NULL, 'recursive,log=E:\log.txt');
DECLARE @data ST_PIXELDATA; SET @data = (SELECT image.getPixelData('level=1') FROM sat); UPDATE sat SET image = image.mosaic(NULL,@data,'log=E:\log.txt');