Applying a color map to raster values in an ST_Raster column

A color map can be applied to a single-band 8- or 16-bit raster value.

To apply a color map to a qualifying raster value, use the ST_Raster setColormap function, which accepts as input the file name of a TIFF image file.

Steps:
  1. Use an UPDATE SQL statement and an input image file to add a color map to specific records in a table.

    In these examples, the color map from the colormap.tif file is used to add a color map to those raster values in the forest table.

    Oracle

    UPDATE FOREST t
    SET raster = t.raster.setColormap('/net/gis/images/colormap.tif');

    PostgreSQL

    UPDATE forest
    SET raster = setColormap(raster,'/net/gis/images/colormap.tif');

    SQL Server

    UPDATE forest
    SET raster = raster.setColormap('/net/gis/images/colormap.tif');

Related Topics


2/5/2013