hydromt.DataArray.raster.to_slippy_tiles#

DataArray.raster.to_slippy_tiles(root: Path | str, reproj_method: str = 'bilinear', min_lvl: int = None, max_lvl: int = None, driver='png', cmap: str | object = None, norm: object = None, write_vrt: bool = False, **kwargs)#

Produce tiles in /zoom/x/y.<ext> structure (EPSG:3857).

Generally meant for webviewers.

Parameters:
  • root (Path | str) – Path where the database will be saved

  • reproj_method (str, optional) – How to resample the data at the finest zoom level, by default ‘bilinear’. See reproject() for existing methods.

  • min_lvl (int, optional) – The minimum and maximum zoomlevel to be produced. If None, the zoomlevels will be determined based on the data resolution

  • max_lvl (int, optional) – The minimum and maximum zoomlevel to be produced. If None, the zoomlevels will be determined based on the data resolution

  • driver (str, optional) – file output driver, one of ‘png’, ‘netcdf4’ or ‘GTiff’

  • cmap (str | object, optional) – A colormap, either defined by a string and imported from matplotlib via that string or as a Colormap object from matplotlib itself.

  • norm (object, optional) – A matplotlib Normalize object that defines a range between a maximum and minimum value

  • write_vrt (bool, optional) – If True, a vrt file per zoom level will be written to the root directory. Note that this only works for GTiff output.

  • **kwargs – Key-word arguments to write file for netcdf4, these are passed to ~:py:meth:xarray.DataArray.to_netcdf: for GTiff, these are passed to ~:py:meth:hydromt.RasterDataArray.to_raster: for png, these are passed to ~:py:meth:PIL.Image.Image.save: