Definition
The ST_Raster.hasColormap function indicates whether or not the ST_Raster has a color map present. It returns 1 if the color map is present and 0 if it is not.
Syntax
Oracle
hasColormap()
PostgreSQL
hasColormap(raster IN ST_RASTER)
SQL Server
hasColormap()
Returns
Oracle
Number
PostgreSQL
Boolean
SQL Server
Integer
Parameters
raster—The ST_Raster object to be tested
Examples
The following two examples illustrate the use of this function in a SELECT and WHERE clause, respectively:
Oracle
SELECT t.image.raster_id, t.image.hasColormap()
FROM FOO t;
T.IMAGE.RASTER_ID T.IMAGE.HASCOLORMAP()
--------------- -------------------
2 0
3 0
23 0
24 0
42 1
43 1
SELECT t.image.raster_id
FROM FOO t
WHERE t.image.hasColormap() = 1;
T.IMAGE.RASTER_ID
-----------------
42
43
PostgreSQL
SELECT raster_id(image), hasColormap(image)
FROM foo t;
RASTER_ID(IMAGE) IMAGE.HASCOLORMAP(IMAGE)
---------------- ------------------------
2 0
3 0
23 0
24 0
42 1
43 1
SELECT raster_id(image)
FROM foo
WHERE hasColormap(image) = 1;
RASTER_ID(IMAGE)
----------------
42
43
SQL Server
SELECT image.raster_id, image.hasColormap()
FROM foo;
IMAGE_RASTER_ID IMAGE.HASCOLORMAP()
---------------- ------------------------
2 0
3 0
23 0
24 0
42 1
43 1
SELECT raster_id(image)
FROM foo
WHERE image.hasColormap() = 1;
IMAGE.RASTER_ID
---------------
42
43