Skip to content

Commit

Permalink
SetNoDataValue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Sep 2, 2023
1 parent f4f69eb commit f9ca425
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gemgis/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,9 @@ def read_raster(path=str,
.. versionadded:: 1.0.x
.. versionchanged:: 1.1.1
Set nodata value manually if no data value is provided and raster does not contain nodata values
Example
_______
Expand Down Expand Up @@ -688,7 +691,10 @@ def read_raster(path=str,

# Setting the nodata value
if nodata_val is None:
nodata_val = data.nodatavals
try:
nodata_val = data.nodatavals
except AttributeError:
nodata_val = -9999

# Setting nans
nans = values == nodata_val
Expand Down

0 comments on commit f9ca425

Please sign in to comment.