Closed apiwat-chantawibul closed 2 years ago
Viewing in another way, maybe the problem has to do with how .set_crs()
sets an internal variable instead of something like .attrs
which would have been copied automatically.
Okay, I just found rio.write_crs()
that explains a lot. So rio.set_crs()
has to be followed by rio.write_crs()
to make the CRS change portable. And then there is also rio.write_coordinate_system()
for some reason. All this seems like a great trap for new users to me. Right now I'm just keeping this issue open in case anyone want to discuss why it has to be this way and how to possibly improve it.
I recommend reading the Getting Started: Introductory Information references for rioxarray. The Coordinare Reference System Management section is relevant for this issue.
Related #356
Code Sample
Problem description
Currently it outputs:
Meaning CRS information is lost by .copy()
Expected Output
Environment Information
Tested on