get_nodata_value_from_dtype

get_nodata_value_from_dtype#

get_nodata_value_from_dtype(dtype) float[source]#

Get default nodata value from any given dtype.

Parameters:

dtype – Dtype for the wanted nodata. Best if numpy’s dtype.

Returns:

Nodata value

Return type:

int

Examples

>>> rasters.get_nodata_value_from_dtype("uint8")
255
>>> rasters.get_nodata_value_from_dtype("uint16")
65535
>>> rasters.get_nodata_value_from_dtype("int8")
-128
>>> rasters.get_nodata_value_from_dtype("float")
-9999