Skip to content

Commit

Permalink
Fix band nodata value (#167)
Browse files Browse the repository at this point in the history
Co-authored-by: juanrmn <jgonzalez@cartodb.com>
  • Loading branch information
juanrmn and juanrmn authored Mar 7, 2025
1 parent af835d4 commit 2bf9bb5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions raster_loader/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@ def band_original_nodata_value(
def band_value_as_string(
raster_dataset: rasterio.io.DatasetReader, band: int, value: float
) -> str:
return (
str(np.array(value).astype(raster_dataset.dtypes[band - 1]))
if value is not None
else None
)
tmpValue = np.array(value).astype(raster_dataset.dtypes[band - 1])
return str(value) if not np.isnan(tmpValue) else np.nan


def band_nodata_value(raster_dataset: rasterio.io.DatasetReader, band: int) -> float:
Expand Down

0 comments on commit 2bf9bb5

Please # to comment.