ST_Raster.setColormap

Definition

The ST_Raster.setColormap function inserts a raster color map into an ST_Raster object. The function will overwrite a color map if one exists. The function returns an error if the ST_Raster object is not single band with either a 1-bit, 4-bit, 8-bit, or 16-bit pixel depth.

Syntax

Oracle

setColormap (fileName IN VARCHAR2) RETURN ST_RASTER

PostgreSQL

setColormap (raster IN ST_RASTER, 
             fileName IN TEXT) RETURN ST_RASTER

SQL Server

setColormap (fileName IN VARCHAR) RETURN ST_RASTER

Returns

ST_Raster

Parameters

Parameter

Description

filename

The full path to the image file that contains the color map index to be loaded

raster

The ST_Raster object for which the color map will be set

Example

In this example, the color map is set on an ST_Raster object that corresponds to the table row that has a raster_id column value of 46.

Oracle

UPDATE AERIALS t
SET image = t.image.setColormap('colormap_table')
WHERE t.image.raster_id = 46;

PostgreSQL

UPDATE aerials 
SET image = setColormap(image,'colormap_table')
WHERE raster_id(image) = 46;

SQL Server

UPDATE aerials
SET image = image.setColormap('colormap_table')
WHERE image.raster_id = 46;

11/18/2013