rioxarray icon indicating copy to clipboard operation
rioxarray copied to clipboard

Document difference between `set_crs` and `write_crs`

Open ttencate opened this issue 1 year ago • 4 comments

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 :wink:

Maybe consider write_coordinate_system in this issue as well.

ttencate avatar Feb 12 '24 11:02 ttencate

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.

snowman2 avatar Feb 12 '24 13:02 snowman2

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

ttencate avatar Feb 12 '24 13:02 ttencate

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

snowman2 avatar Feb 12 '24 14:02 snowman2

Related #356

snowman2 avatar Feb 22 '24 13:02 snowman2