Skip to content

Add string representation to rio acccessor #917

@remi-braun

Description

@remi-braun

To help to quickly grasp a dataset information, a bit like printing ds.profile in rasterio or running gdalinfo, it could be great to add a string representation to the accessor.

Something like :

import rioxarray
>>> xda = rioxarray.open_rasterio(r"my_raster.tif")
>>> print(xda.rio)
rioxarray accessor (.rio) | RasterDataset
Variables:
        Name: 'Slope'
        'Slope' attributes:
                count: 1
                crs: 4326
                rasterio_dtype: float64
                nodata: -9999.0
                transform: | 0.00, 0.00,-94.30|
| 0.00,-0.00, 42.35|
| 0.00, 0.00, 1.00|
                height: 50
                width: 35
                blockxsize: 35
                blockysize: 1
                bounds: (-94.30306000000002, 42.350229999999996, -94.30271000000002, 42.350730000000006)
        Name: 'Red'
        'Red' attributes:
                count: 1
                crs: 4326
                rasterio_dtype: float64
                nodata: -9999.0
                transform: | 0.00, 0.00,-94.30|
| 0.00,-0.00, 42.35|
| 0.00, 0.00, 1.00|
                height: 50
                width: 35
                blockxsize: 35
                blockysize: 1
                bounds: (-94.30306000000002, 42.350229999999996, -94.30271000000002, 42.350730000000006)

Issue based on #911

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