Syntax @ReinterpretRaster([REJECTABLE], RASTER, , , , , , , , [, ]) @ReinterpretRaster([REJECTABLE], BAND, , , , , , ) @ReinterpretRaster([REJECTABLE], PALETTE, , , , [, ]) Arguments REJECTABLE Specifies if the function will supply a rejection code and message to the invalid feature and output it to the rejected port, or will fail upon being supplied invalid features. A feature can be rejected for the following reasons: - The feature has invalid geometry - The raster has no bands The desired destination interpretation for the raster, including data type and bit depth. For color rasters, the bit depth can refer to the total bit depth of the color components combined. So, RGBA64 refers to an interpretation containing four color components (red, green, blue and alpha) with a bit depth of 16 bits per component, resulting in 64 bits total. Range: (ALPHA8|ALPHA16|BLUE8|BLUE16|RED8|RED16|RGBA32|RGB24|RGBA64|RGB48| GRAY8|GRAY16|GREEN8|GREEN16|INT8|INT16|INT32|INT64|UINT8|UINT16|UINT32| UINT64|REAL32|REAL64) The desired destination interpretation to which each individual band is to be converted, including data type and bit depth. Range: (ALPHA8|ALPHA16|BLUE8|BLUE16|RED8|RED16|GRAY8|GRAY16|GREEN8| GREEN16|INT8|INT16|INT32|INT64|UINT8|UINT16|UINT32|UINT64|REAL32|REAL64) The desired destination interpretation to which each palette value is to be converted, including data type and bit depth. The bit depth can refer to the total bit depth of the color components combined. Range: (RGBA32|RGB24|RGBA64|RGB48|GRAY8|GRAY16|STRING) The action to take when covnerting from multiple bands to a single band. Range: (AVERAGE) The action to take when converting from RGBA to RGB. DROPALPHA discards the alpha band and APPLYALPHA multiples each RGB value with the corresponding, normalized alpha value. Range: (DROPALPHA|APPLYALPHA) The action to take when converting from one color interpretation to another. CAST performs a C-style cast on the values. BOUNDED_CAST performs a C-style cast on the values but also performs bounds-checking. DATASCALE scales the extremum of the source data values to the extrumum of the destination data type. TYPESCALE scales the extremeum of the source data type to the extremum of the destination type. Range: (CAST|BOUNDED_CAST|DATASCALE|TYPESCALE) The action to take when converting from color interpretations to numeric interpretations. See . Range: (CAST|BOUNDED_CAST|DATASCALE|TYPESCALE) The action to take when converting from numeric interpretations to color interpretations. See . Range: (CAST|BOUNDED_CAST|DATASCALE|TYPESCALE) The action to take when converting from numeric interpretations to numeric interpretations. See . Range: (CAST|BOUNDED_CAST|DATASCALE|TYPESCALE) The action to take when converting from floating-point values to integer. ROUND rounds the value to the nearest integer. CEIL gets the next integer which is greater than or equal to the floating-point value. FLOOR gets the next integer which is less than or equal to the floating-point value. Range: (ROUND|CEIL|FLOOR) Action to take when converting from RGB to RGBA. Range: (CREATEOPAQUEALPHA | CREATEALPHAFROMNODATA) Description The @ReinterpretRaster function is used to change the underlying interpretation of the bands and palettes of a raster. It can be used in three modes: RASTER, BAND, or PALETTE. In RASTER mode, the function acts on the raster as a whole, ignoring selection, and can change the number of bands on the raster. For example, this mode can be used to convert a raster containing 3 bands directly to RGB or RGBA. The raster cannot contain any palettes in RASTER mode. Here is a summary of the possible conversions: Converting to RGBA is possible from one band (duplicating it and adding an opaque alpha band), three bands (adding an opaque alpha band), and four bands. Converting to RGB is possible from one band (duplicating it), three bands, and four bands if the four bands are already RGBA. Converting from four RGBA bands to RGB will either drop or apply alpha, depending on the chosen option. You can convert any four bands to RGB by first converting them to RGBA, then converting them to RGB. Converting to a single band is possible from any number of bands. This will average all input bands into the resulting band. When averaging multiple bands, DATASCALE and TYPESCALE options are not permitted. It is possible to work around this limitation by doing the conversion in two steps. For example, to average a RGB48 raster into a GRAY8 band using TYPESCALE, consider first averaging to GRAY16 in raster mode, and then using a TYPESCALE conversion to GRAY8 in BAND mode. In BAND mode, the function acts on each selected band individually. If the band contains palettes, regardless of selection, the palette keys will be modified to match the band if possible. This is only the case if the destination band interpretation is UINT8, UINT16 or UINT32. If a raster contains multiple selected bands, each of these bands will be converted to the destination interpretation independently. Thus, if a GRAY8 interpretation is requested on a three band raster with no palettes, and only the first two bands are selected, then only the first two bands are converted to GRAY8, the third band will be left untouched. In PALETTE mode, the function acts on each selected palette in each selected band. This mode does not support selected bands without palettes. If a raster contains multiple selected bands with multiple selected palettes, each palette will be converted to the destination interpretation independently. Converting palettes to string interpretation will either create an integer string, or a CSV string, depending on the input interpretation. String palettes created using this function will currently have a maximum length of 63 characters. Not all parameters passed to a function make sense all the time. For example, when converting to INT16 in BAND mode, the and options will not be used because the destination type is not a color interpretation. Another example would be the parameter when the destination interpretation is REAL32 or REAL64. Also, some parameters might be used in some cases, but not others, like the parameter, which is going to be used only when the input palette or raster has a RGBA interpretation. All parameters always have to be provided to define the behavior of the function for all possible inout interpretations. The TYPESCALE option is mainly used when converting color interpretations to color interpretations, so that both the source and destination look exactly the same when rendered in the Viewer. The DATASCALE option is mostly used when converting numeric interpretations to color interpretations, in order to give a good visualization of the data in the Viewer. In BAND mode, the function will not copy data if it does not have to. When converting between interpretations that have the same underlying data type and without asking for a DATASCALE, no superfluous copy will occur. This type of conversion is very efficient. Sequential functions are not combined. If several ReinterpretRaster functions are performed in sequence, or if the resulting converted raster is output to a format that cannot support the converted type, then potentially multiple conversions will take place and data quality and translation performance may suffer. Conversion of the data types of raster bands may cause existing data and nodata values to be combined. For example, converting the data values from UInt32 to UInt8 may cause several possible source values to be converted to the same destination value. If one of the values was nodata then it is possible that several data and nodata values may share the same destination value and thus the data values will be destroyed. This can be mitigated by either removing the nodata value before conversion or setting the nodata value intelligently if the data values and conversion operation are well understood. This function supports sub-selection of raster bands and palettes in BAND and PALETTE mode only.