odc.geo.xr.ODCExtension.explore

ODCExtension.explore(map: Any | None = None, bands: Tuple[str, str, str] | None = None, vmin: float | None = None, vmax: float | None = None, cmap: Any | None = None, robust: bool = False, tiles: Any = 'OpenStreetMap', attr: str | None = None, layer_control: bool = True, resampling: str = 'nearest', map_kwds: Dict[str, Any] | None = None, **kwargs: Any) Any

Plot xarray data on an interactive folium leaflet map for rapid data exploration.

xarray.Dataset inputs are automatically converted to multi-band RGB plots, while single-band xarray.DataArray inputs can be plotted using matplotlib colormaps (needs matplotlib installed).

Parameters:
  • xx (Any) – The Dataset or DataArray to plot on the map.

  • map (Optional[Any]) – An optional existing folium map object to plot into. By default, a new map object will be created.

  • bands (Optional[Tuple[str, str, str]]) – Bands used for RGB colours when converting from a Dataset (order should be red, green, blue). By default, the function will attempt to guess bands automatically. Ignored for DataArray inputs.

  • vmin (Optional[float]) – Lower value used for the color stretch.

  • vmax (Optional[float]) – Upper value used for the color stretch.

  • cmap (Optional[Any]) – The colormap used to colorise single-band arrays. If not provided, this will default to ‘viridis’. Ignored for multi-band inputs.

  • robust (bool) – If True (and vmin and vmax are absent), the colormap range will be computed based on 2nd and 98th percentiles, minimising the influence of extreme values. Used for single-band arrays only; ignored for multi-band inputs.

  • tiles (Any) – Map tileset to use for the map basemap. Supports any option supported by folium, including “OpenStreetMap”, “CartoDB positron”, “CartoDB dark_matter” or a custom XYZ URL.

  • attr (Optional[str]) – Map tile attribution; only required if passing custom tile URL.

  • layer_control (bool) – Whether to add a control to the map to show or hide map layers. If a layer control already exists, this will be skipped.

  • resampling (str) – Custom resampling method to use when reprojecting xx to the map CRS; defaults to “nearest”.

  • map_kwds (Optional[Dict[str, Any]]) – Additional keyword arguments to pass to folium.Map.

  • kwargs (Any) – Additional keyword arguments to pass to .odc.add_to().

Return type:

Any

Returns:

A folium map containing the plotted xarray data.