Syntax FACTORY_DEF NeighborColorSetterFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [GROUP_BY []+]* [FLUSH_WHEN_GROUPS_CHANGE (Yes|No)] [ALGORITHM (SIMPLE|FIVE_COLOR|MANUAL|RANDOM|RANDOM_OFFSET)] [RANDOM_COLOR_CAP ] [PEN_COLOR ] [FILL_COLOR ] [COLOR_ID_ATTR ] [SET_COLORS (YES|NO)] [AREA_ID_ATTR ] [NEIGHBOR_IDS_ATTR ] [REJECT_INVALID_PARAMS (Yes|No)] [OUTPUT (COLORED|REJECTED) FEATURE_TYPE [ ]* []*]* Overview This factory assigns colors to areas in a coverage such that adjacent areas are colored differently, and the total number of colors used is kept small. ALGORITHM When ALGORITHM is set to SIMPLE, each area is colored with the first available color. Ideally, only a few colors will be used, but the total number of colors is not guaranteed. When ALGORITHM is set to FIVE_COLOR, at most five colors will be used to color all of the regions. When ALGORITHM is set to MANUAL, the color will be set to the colors specified in PEN_COLOR and FILL_COLOR. When ALGORITHM is set to RANDOM, each area will be assigned a random color for both its pen and fill color. When ALGORITHM is set to RANDOM_OFFSET, each area will be assigned a random color for both its fill color, with a slightly darker variation of its fill color as its pen color. RANDOM_SEED The random seed string here will either be used as its numeric value or will be hashed and used as a numeric value for reproducibility. RANDOM_COLOR_CAP The non-negative integer here will be used as an upper limit on the number of unique colors that will be used when using the RANDOM or RANDOM_OFFSET ALGORITHM setting. PEN_COLOR The color specified here will be used as the pen color when ALGORITHM is in MANUAL mode. FILL_COLOR The color specified here will be used as the fill color when ALGORITHM is in MANUAL mode. COLOR_ID_ATTR Colors for each region are output to this attribute as integers (the first color is 0, the second is 1, etc.). If the default fill colors are not desired (see SET_COLORS below), this attribute may be manipulated to provide alternate colors for the regions (e.g., mapping from 0 to red, 1 to green, etc.). SET_COLORS If SET_COLORS is YES, pen and fill colors will be assigned to each area based on a default color scheme. AREA_ID_ATTR and NEIGHBOR_IDS_ATTR When AREA_ID_ATTR and NEIGHBOR_IDS_ATTR are specified, these attributes are used to determine which areas are adjacent to each other, and therefore should be colored differently. Each input area must have an ID (a non- negative integer provided in the AREA_ID_ATTR attribute) as well as a list of all neighboring areas' IDs (as a comma-delimited list in the NEIGHBOR_IDS_ATTR attribute). When AREA_ID_ATTR and NEIGHBOR_IDS_ATTR are not specified, adjacencies between areas are determined geometrically. In this case, the input areas must consist solely of polygons that form a coverage (i.e., they must not overlap and there may not be empty space between areas that should be adjacent). Any non-polygon features will be dropped. REJECT_INVALID_GEOM When REJECT_INVALID_PARAMS is Yes, the factory will output invalid features to Rejected port. GROUP_BY This clause allows for processing features in groups based on one or more attributes on the input features. Processing will only be performed on input features whose group by attributes (as specified by this clause) are identical. FLUSH_WHEN_GROUPS_CHANGE If the GROUP_BY clause is specified, this clause (when set to Yes) will cause the factory to process and output the current group immediately when an attribute that does not belong to the current group is encountered. Output Tags This factory supports the following output tags. COLORED The original features, augmented with the COLOR_ID_ATTR attribute.