corteva / rioxarray

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

Adding rasterio's colourmap functionality #706

Open cnavacch-spire opened 8 months ago

cnavacch-spire commented 8 months ago

When writing GeoTIFF files from an xarray.DataArray, the possibility to write colourmaps is currently not provided (if I have not overseen sth.):

https://rasterio.readthedocs.io/en/stable/topics/color.html#writing-colormaps

Adding an additional keyword to the profile_kwargs of the to_raster() method and calling the write_colormap() function from within the rasterio.open(...) context should do the job.

Many thanks for the great work so far!

snowman2 commented 8 months ago

Related: #414