odc.geo.xr.ODCExtensionDa.add_to

ODCExtensionDa.add_to(map: Any, *, name: Optional[str] = None, fmt: str = 'png', max_size: int = 4096, transparent_pixel: Optional[Tuple[int, int, int]] = None, cmap: Optional[Any] = None, clip: bool = False, vmin: Optional[float] = None, vmax: Optional[float] = None, **kw) Any

Add image to a map.

If map is not supplied, image data url and bounds are returned instead.

Parameters
  • xx (Any) – array to display

  • map (Any) – Map object, folium and ipyleaflet are understood, can be None.

  • name (Optional[str]) – Image layer name

  • fmt (str) – compress image format, defaults to “png”, can be “webp”, “jpeg” as well.

  • max_size (int) – If longest dimension is bigger than this, shrink it down before compression, defaults to 4096

  • transparent_pixel (Optional[Tuple[int, int, int]]) – Replace transparent pixels with this value, needed for “jpeg”.

  • cmap (Optional[Any]) – If supplied array is not RGB use this colormap to turn it into one

  • clip (bool) – When converting to RGB clip input values to fit cmap.

  • vmin (Optional[float]) – Used with matplotlib colormaps

  • vmax (Optional[float]) – Used with matplotlib colormapa

Raises

ValueError – when map object is not understood

Returns

ImageLayer that was added to a map

Return type

Any

Returns

(url, bounds) when map is None.

See also

colorize(), to_rgba()