This is an old revision of the document!
Categorization Type
A categorization is a set of categories (classes) used to label the cells of a Categorical Map — each category defined by a value, a name, and a display color.
GUI Editor

EGO Script
A constant representing a set of categories is written in EGO Script using the following syntax:
[ 1, "Rondonia", (139, 35, 35), 2, "Acre", (105, 211, 169), 3, "Amazonas", (149, 149, 238), 4, "Roraima", (177, 177, 66), 5, "Para", (238, 203, 149), 6, "Amapa", (62, 12, 96), 7, "Tocantins", (238, 149, 149), 8, "Maranhao", (51, 255, 204), 9, "Mato_Grosso", (211, 105, 211) ]
Each line describes one category through three elements: its value, name, and color.
- Value — a positive or negative integer corresponding to a cell value in a categorical map. Ex:
-10,1,200. - Name — a non-empty string enclosed in double quotes. It must start with a letter, followed by letters, numbers, and underscores (
_). Ex:“forest”,“deforestation”,“class_1”. - Color — a three-element tuple enclosed in parentheses, using the (R, G, B) notation: red, green, and blue components, in that order. Each component must be in the range [0, 255]. Ex:
(255, 0, 0),(128, 128, 128).(0, 0, 0)is black and(255, 255, 255)is white.
Commas between elements are optional. Categories do not need to be contiguous.
Automatic Conversions
Table Type: conversion is possible in both directions — from a Table into a Categorization, and from a Categorization into a Table. In either direction, the table must have the following columns, in order:
| Column | Type | Description |
|---|---|---|
| Category value | *#real (key) | The category value. |
| Category name | #string | The category name. |
| Category red color | #real | The category's red color component, in the range [0, 255]. |
| Category green color | #real | The category's green color component, in the range [0, 255]. |
| Category blue color | #real | The category's blue color component, in the range [0, 255]. |
The following CSV table represents the same categories shown in the EGO Script example above:
Value*, Name, Color_Red, Color_Green, Color_Blue, 1, Rondonia, 139, 35, 35, 2, Acre, 105, 211, 169, 3, Amazonas, 149, 149, 238, 4, Roraima, 177, 177, 66, 5, Para, 238, 203, 149, 6, Amapa, 62, 12, 96, 7, Tocantins, 238, 149, 149, 8, Maranhao, 51, 255, 204, 9, Mato_Grosso, 211, 105, 211