-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Rasterio missing _FillValue in DataArray #1736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree that it would be nice to have. It seems that the corresponding rasterio attribute is |
What I'm not sure, though, is if we should rename the attribute to _FillValue or keep its name as it is. I am also not sure if we should do the automatic conversion as it is done with the netCDF backends. Quite often geotiff files store iteger types, and filling with NaNs require floats. Right now I would tend to just parse the |
One thought I had was that there could be a similar parameter to I would vote for adding the _FillValue attribute as it conforms with the CF conventions and it will make the dataset work better with other software looking for this value if you write it out with Also, on a similar vein, it would be nice to break out the bands into separate variables if it is a multi-band raster. This way, each band can store it's own nodata value and metadata separately in the dataset. |
* Added nodatavals attribute Connected with issue #1736 * Replace None nodatavals with np.nan Fixes the type error with serialization: https://travis-ci.org/pydata/xarray/jobs/306107679 * Fix typo * Added nodatavals open_rasterio information. * added issue and author information * added tests for nodatavals attr * moved back to nan * added separate test for missing nodataval
Is there still interest in implementing the |
It would definitely be a fantastic feature to have. Some discussion happened in #2308 to discuss standardizing methods for storing data that would definitely assist with this, however it did not seem like a priority at the time. Definitely feel free to share your opinion and use cases. |
Problem description
When xarray opens a dataset, it stores the the _FillValue in the encoding and replaces values with NaN values. However, using open_rasterio, this behavior does not occur and the _FillValue value is missing. It only has the transform, crs, is_tiled, and res attributes. Also, the encoding is empty.
Expected Output
It would be nice to have the _FillValue as an attribute or in the encoding.
Output of
xr.show_versions()
xarray: 0.10.0rc2
pandas: 0.21.0
numpy: 1.13.2
scipy: 1.0.0
netCDF4: 1.3.1
h5netcdf: 0.5.0
Nio: dev_20170921-05806a2
bottleneck: 1.2.1
cyordereddict: None
dask: 0.15.4
matplotlib: 2.1.0
cartopy: None
seaborn: None
setuptools: 36.6.0
pip: 9.0.1
conda: None
pytest: 3.2.5
IPython: 6.2.1
sphinx: None
The text was updated successfully, but these errors were encountered: