geodata.mask.ras_to_xarr

geodata.mask.ras_to_xarr#

geodata.mask.ras_to_xarr(raster: str, band_name: str | None = None, adjust_coord: bool = True) xarray.DataArray#

Open a raster (rasterio openner) with rioxarray

Parameters:
  • raster (str) – The path to the raster

  • band_name (str) – The name of the band. This is optional. If no band name is specified, no band will be renamed.

  • adjust_coord (bool) – Whether to adjust the coordinate names to lat/lon. True by default.

Returns:

The opened raster as xarray DataArray.

Return type:

xarray.DataArray