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, robust: Optional[bool] = 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
- Returns
ImageLayer that was added to a map
- Return type
- Returns
(url, bounds)
whenmap is None
.
See also