fmeobjects.FMERasterTools.generatePalette
- FMERasterTools.generatePalette(interpretation, numPaletteEntries, raster, parms)
Replaces the selected band(s) on the raster by a new band with a new palette.
The palette will have at most ‘numPaletteEntries’ number of entries and the interpretation.
The interpretation must be large enough for the numPaletteEntries. For example, when the interpretation is
FME_INTERPRETATION_UINT8
, then the ‘numPaletteEntries’ must not be larger than 256. If the interpretations of the selected bands do not make up a valid palette value interpretation, exception will be raised.- Parameters:
interpretation (int) –
Interpretation of the palette key. Choose one of:
FME_INTERPRETATION_UINT8
FME_INTERPRETATION_UINT16
FME_INTERPRETATION_UINT32
numPaletteEntries (int) – Number of palette entries.
raster (FMERaster) – Raster object where the bands belong.
parms (dict[str, str]) – (Optional) Name-value pair representing additional parameters. Currently, no additional parameters exist.
- Return type:
- Returns:
The raster after generating palette.
- Raises:
FMEException – An exception is raised if an error occurred.