This topic describes the ST_MosaicFrom function, which performs a mosaic operation to combine multiple raster objects into a new raster object.
raster ST_MosaicFrom(raster source, cstring chunkTableName);
|source||The name of the raster objects that you want to combine.|
|chunkTableName||The name of the chunk table for storing the new raster object. The name must comply with the table naming conventions of ApsaraDB RDS for PostgreSQL.|
This function combines multiple raster objects into a new one.
- They have the same number of bands.
- They are all geographically referenced, or none of them is geographically referenced. If all of them are geographically referenced, world coordinates (geographic coordinates) are used for the mosaic operation.
- Although they can have different pixel types, they must have the same spatial reference system identifier (SRID) and affine parameters if world coordinates are used for the mosaic operation.
You must configure the following parameter.
|ganos.raster.mosaic_must_same_nodata||boolean||Specifies whether the values of NoData in a data source must be the same during the
mosaic operation. Valid values: true and false. The values of NoData are not changed
during the mosaic operation. If you set this parameter to false, the semantics of
the pixels after the mosaic operation may be changed. Example:
INSERT INTO raster_table VALUES(1, ST_MosaicFrom(Array(SELECT raster_obj FROM raster_table WHERE id < 10), 'chunk_table_mosaic')) UPDATE raster_table SET raster_obj = ST_MosaicFrom(Array(SELECT raster_obj FROM raster_table WHERE id < 10), 'chunk_table_mosaic') WHERE id = 11;