odc.geo.xr.add_to
- odc.geo.xr.add_to(xx, map, *, name=None, index=None, fmt='png', max_size=4096, resampling='nearest', transparent_pixel=None, cmap=None, clip=False, vmin=None, vmax=None, robust=None, **kw)[source]
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