corteva / rioxarray

geospatial xarray extension powered by rasterio
https://corteva.github.io/rioxarray
Other
502 stars 80 forks source link

Document difference between `set_crs` and `write_crs` #743

Open ttencate opened 4 months ago

ttencate commented 4 months ago

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.

snowman2 commented 4 months ago

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 commented 4 months ago

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

snowman2 commented 4 months ago

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

snowman2 commented 4 months ago

Related #356