odc.geo.xr.ODCExtensionDa.add_to
- ODCExtensionDa.add_to(map: Any, *, name: str | None = None, fmt: str = 'png', max_size: int = 4096, transparent_pixel: Tuple[int, int, int] | None = None, cmap: Any | None = None, clip: bool = False, vmin: float | None = None, vmax: float | None = None, robust: bool | None = 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 displaymap (
Any
) – Map object,folium
andipyleaflet
are understood, can beNone
.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 4096transparent_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 oneclip (
bool
) – When converting to RGB clip input values to fitcmap
.robust (
Optional
[bool
]) – Used with matplotlib colormaps,vmin=2%,vmax=98%
- Raises:
ValueError – when map object is not understood
- Return type:
- Returns:
ImageLayer that was added to a map
- Returns:
(url, bounds)
whenmap is None
.
See also