odc.geo.xr.ODCExtensionDa.add_to
- ODCExtensionDa.add_to(map: Any, *, name: str | None = None, index: int | None = None, fmt: str = 'png', max_size: int = 4096, resampling: str = 'nearest', 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 an interactive map.
If map is not supplied, image data url and bounds are returned instead.
- Parameters:
map (
Any
) – Map object,folium
andipyleaflet
are understood; can also beNone
which will return an image data url and bounds instead.name (
Optional
[str
]) – The name of the layer as it will appear infolium
andipyleaflet
Layer Controls. The defaultNone
will use the input array name (e.g.xx.name
) if it exists.fmt (
str
) – Compress image format. Defaults to “png”; also supports “webp”, “jpeg”.max_size (
int
) – If longest dimension is bigger than this, shrink it down before compression; defaults to 4096.resampling (
str
) – Custom resampling method to use when reprojectingxx
to the map CRS; defaults to “nearest”.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 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