Skip to content
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

Document difference between set_crs and write_crs #743

Closed
ttencate opened this issue Feb 12, 2024 · 4 comments · Fixed by #793
Closed

Document difference between set_crs and write_crs #743

ttencate opened this issue Feb 12, 2024 · 4 comments · Fixed by #793
Labels
bug Something isn't working documentation Documentation related issue good first issue Good for newcomers

Comments

@ttencate
Copy link

set_crs:

Set the CRS value for the Dataset/DataArray without modifying the dataset/data array.

write_crs:

Write the CRS to the dataset in a CF compliant manner.

The input_crs and inplace arguments are the same; the only difference in signature is that write_crs takes an optional grid_mapping_name.

In short, I'm confused 😉

Maybe consider write_coordinate_system in this issue as well.

@ttencate ttencate added the bug Something isn't working label Feb 12, 2024
@snowman2
Copy link
Member

Looks like you found this: https://corteva.github.io/rioxarray/stable/getting_started/crs_management.html

set_crs is not recommended to use because the CRS doesn't persist.

@ttencate
Copy link
Author

Good to know, thanks. Would be great if the docs noted this, and also explained what set_crs would be used for.

@snowman2
Copy link
Member

Thank you for your suggestions! Contributions are welcome and appreciated.

@snowman2 snowman2 added the documentation Documentation related issue label Feb 12, 2024
@snowman2
Copy link
Member

Related #356

@snowman2 snowman2 added the good first issue Good for newcomers label Apr 3, 2024
dluks added a commit to dluks/rioxarray that referenced this issue Jul 3, 2024
There is some confusion around when to use write_crs versus set_crs. This adds a small note to generally prefer write_crs when CRS persistence is needed. Fixes corteva#743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Documentation related issue good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants