leftfield-geospatial / geedim

Search, composite, and download Google Earth Engine imagery.

Home Page:https://geedim.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to define nodata value [Feature request]

lbferreira opened this issue · comments

First, thank you for this awesome lib!
In the current implementation, the value used to represent nodata is defined automatically based on the data type. Offering the user the possibility to define it manually can be very useful. For example, if you try to export an image (uint8) with valid zero values, it will result in a bad behavior since 0 is used as nodata value for uint8. I faced a similar problem trying to export Google Dynamic World classes. To overcome this limitation, I had to unmask the image using the value 255 (value to represent nodata) and pass set_nodata = False to geedim. However, I lost the possibility to set 255 as nodata in the geotiff file metadata.

Hello. Thanks for the request.

At the moment geedim uses the nodata value as it comes from Earth Engine. I am reluctant to change this, as I think it works for most use cases. You could use another dtype whose nodata value doesn't overlap with valid values in your image (nodata values are the minimum possible value for integer types and nan for float types). Or shift the range of the image values to not overlap nodata.

I understand. No problem. Thank you for your attention.