girs.rast.raster.get_default_values¶
-
get_default_values
(number_of_bands, values)¶ Return values for bands
Utility function to get values (e.g., nodata) for bands.
For n = number_of_bands: - If values is a single value, transform it into a list with n elements - If values is a list with size lower than n, extend the list to size n by repeating the last value (n=4, values=[1, 2], result=[1, 2, 2, 2] - If values is a list with size greater than n, slice values to values[:n]
Parameters: - number_of_bands (int) – number of bands
- values (same as raster type) – value or list of values
Returns: values
Return type: same as input values