Search code examples
pythonpython-xarrayrasterio

Not using band as dimension while reading raster using xarray


I am reading in a single band raster using xarray. Is there a way to not have band be a dimension and just have the x and y coordinates as dimensions?


Solution

  • You mean directly when reading the file?

    Because you can always do this after reading the file:

    ds = ds.sel(band = 1)
    

    It should return a dataset with only x and y as coords.