How to store encoded_nodata ? #313
Unanswered
remi-braun
asked this question in
Q&A
Replies: 2 comments 7 replies
-
It works if I state this: xda_out.encoding = xda.encoding But isn't it a bit complicated to write 4 lines of code to get back the raster metadata integrity after a simple operation ? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Another question about this # xda: some xr.DataArray without set any nodata
xda_nodata = xda.where(xda !=nodata_val)
xda_nodata.rio.write_nodata(None, inplace=True)
xda_nodata.encoding["_FillValue"] = nodata_val Is there another shortcut ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I did an addition between two xarrays and as seen in the example I lost the attributes (except the CRS, I don't know if its normal)
I managed to set them back as stated, except the
encoded_nodata
:How do I achieve that ? Because I work with nodata pixels ==
nan
and I need to write the correct value back when I save the raster to disk.Beta Was this translation helpful? Give feedback.
All reactions