Map and Table Calculation

MAPCOLOR( ) function

Returns the (R,G,B) colors of a certain pixel of a raster map RasterMap, from the map's default representation (class or value). 

Syntax

MAPCOLOR(RasterMap)
MAPCOLOR(RasterMap, RowNr, ColumNr)

Input

RasterMap is a raster map
RowNr is the row number of a certain pixel
ColumnNr is the column number of a certain pixel

Output

MAPCOLOR returns: a color
Domain: system domain Color

Notes:

Tip:

When the definition symbol = is used, a dependent output map or dependent output column is created; when the assignment symbol := is used, the dependency link is immediately broken after the output map/column has been calculated.

Usable in

MapCalc, Simple calculators

Examples

Pocket line calculator example:

? MAPCOLOR(DEM,150,200)

retrieves the color of map DEM at row 150 and column 200, e.g. (255, 89, 16)

MapCalc example:

To convert raster map Landuse (class domain Landuse, using representation class Landuse) to a raster map LandColor with the Color domain:

LandColor = MAPCOLOR(Landuse)

Landuse.rpr

Landunit

Colorname

Color

Agriculture

Yellow

(255, 255, 0)

Airport

Red

(255, 0, 0)

Bare soils

Brown

(164, 40, 40)

Forest

Forest Green

(48, 128, 76)

Grass

Yellow Green

(98, 98, 98)

Lake

Blue

(0, 0, 255)

Riverbed

Cyan

(0, 255, 255)

Rocks

Gray

(128, 128, 128)

Shrubs

Magenta

(255, 0, 255)

 

Landuse

LandColor

Forest Forest Rocks
Shrubs Lake Grass
? Grass Airport
(48,128,76) (48,128,76) (128,128,128)
(255,0,255) (0,0,255) (98,98,98)
(0,0,0) (98,98,98) (255,0,0)

See also:

COLOR CLRGREEN CLRYELLOW CLRHUE
MAPCOLOR CLRBLUE CLRMAGENTA CLRSAT
RPRCOLOR CLRCYAN CLRINTENS
    CLRGREY COLORHSI