Skip to content

Add ability to describe color interpretation #191

@atharen

Description

@atharen

Ability to handle color interpretation as enabled by Rasterio

Primarily ability to read existing color with Dataset.colorinterp, return the sequence of ColorInterp.<enum>, and the modify a Dataset by overriding it, similar to how descriptions work.

Put example of opening a dataset in r+ just to change description of bands and their respective color implementations:

with rasterio.open(dataset_path, 'r+') as src:
    src.descriptions = band_descriptions
    src.colorinterp = [rasterio.enums.ColorInterp.gray] * len(band_descriptions)

Probably a minor priority issue given that if you have rioxarray you have rasterio as well, but combining them both might be more readable/polished.

To be honest, have not looked as the source code to see if it is easy to implement, but would consider doing it if relatively minor.

For reference, I assume it would be similar for how descriptions work, by modifying the xarray attrs['long_name'].

Not sure if an alternative approach exists (recently started using rioxarray).

Could not find a related issue in either the issues page nor on gis stackexchange

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalIdea for a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions