dea_tools.maps
Tools for generating interactive maps with folium and ipyleaflet.
License: The code in this notebook is licensed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth Australia data is licensed under the Creative Commons by Attribution 4.0 license (https://creativecommons.org/licenses/by/4.0/).
Contact: If you need assistance, please post a question on the Open Data Cube Discord chat (https://discord.com/invite/4hhBQVas5U) or on the GIS Stack Exchange (https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the open-data-cube tag (you can view previously asked questions here: https://gis.stackexchange.com/questions/tagged/open-data-cube).
If you would like to report an issue with this script, you can file one on GitHub (GeoscienceAustralia/dea-notebooks#new).
Last modified: July 2025
Functions
|
Convert xarray dataset to a PNG image by applying the OWS style. |
|
|
|
|
|
|
|
Puts two xarray datasets side-by-side for comparison on to a folium map (see: https://python-visualization.github.io/folium/). |
|
Sensible defaults for a folium dual map based on the bounding box of the image to be shown. |
|
|
|
Puts an xarray Dataset with a single observation in time on to a folium map (see: https://python-visualization.github.io/folium/). |
|
Sensible defaults for a folium map based on the bounding box of the image to be shown. |
|
|
|
|
|
Puts two xarray datasets side-by-side for comparison on to a ipyleaflet map. |
|
Sensible defaults for a ipyleaflet map based on the bounding box of the image to be shown. |
|
Calculate valid data mask array for xarray dataset. |
- dea_tools.maps.apply_ows_style(data, ows_style_config=None)[source]
Convert xarray dataset to a PNG image by applying the OWS style.
- dea_tools.maps.folium_dual_map(left_data, right_data, left_ows_style=None, right_ows_style=None, enable_fullscreen=False, enable_layers_control=False, zoom_start=None, location=None, **folium_map_kwargs)[source]
Puts two xarray datasets side-by-side for comparison on to a folium map (see: https://python-visualization.github.io/folium/).
- Parameters:
data (xarray Dataset) – A dataset with a single observation in time (or without a time dimension)
ows_style_config (dict) – Datacube OWS style configuration (see https://datacube-ows.readthedocs.io/en/latest/styling_howto.html)
enable_fullscreen (bool) – Enable a Full Screen control on the map
enable_layers_control (bool) – Enable a Layers control (that lists the layers to show/hide them)
zoom_start (int) – The zoom level (default: a zoom layer that shows the whole dataset)
location ((float, float)) – The location the starting view is centered on (default: center of the dataset bounds)
- Return type:
the newly created folium map
- dea_tools.maps.folium_dualmap_default(bbox, zoom_start=None, location=None, **kwargs)[source]
Sensible defaults for a folium dual map based on the bounding box of the image to be shown.
- dea_tools.maps.folium_map(data, ows_style_config=None, enable_fullscreen=True, enable_layers_control=False, zoom_start=None, location=None, **folium_map_kwargs)[source]
Puts an xarray Dataset with a single observation in time on to a folium map (see: https://python-visualization.github.io/folium/).
- Parameters:
data (xarray Dataset) – A dataset with a single observation in time (or without a time dimension)
ows_style_config (dict) – Datacube OWS style configuration (see https://datacube-ows.readthedocs.io/en/latest/styling_howto.html)
enable_fullscreen (bool) – Enable a Full Screen control on the map
enable_layers_control (bool) – Enable a Layers control (that lists the layers to show/hide them)
zoom_start (int) – The zoom level (default: a zoom layer that shows the whole dataset)
location ((float, float)) – The location the starting view is centered on (default: center of the dataset bounds)
- Return type:
the newly created folium map
- dea_tools.maps.folium_map_default(bbox, zoom_start=None, location=None, **kwargs)[source]
Sensible defaults for a folium map based on the bounding box of the image to be shown.
- dea_tools.maps.ipyleaflet_map(data, ows_style_config=None, enable_fullscreen=True, enable_layers_control=False, zoom=None, center=None, **ipyleaflet_map_kwargs)[source]
Puts two xarray datasets side-by-side for comparison on to a ipyleaflet map.
- Parameters:
data (xarray Dataset) – A dataset with a single observation in time (or without a time dimension)
ows_style_config (dict) – Datacube OWS style configuration (see https://datacube-ows.readthedocs.io/en/latest/styling_howto.html)
enable_fullscreen (bool) – Enable a Full Screen control on the map
enable_layers_control (bool) – Enable a Layers control (that lists the layers to show/hide them)
zoom_start (int) – The zoom level (default: a zoom layer that shows the whole dataset)
location ((float, float)) – The location the starting view is centered on (default: center of the dataset bounds)
- Return type:
the newly created ipyleaflet map
- dea_tools.maps.ipyleaflet_map_default(bbox, zoom=None, center=None, **kwargs)[source]
Sensible defaults for a ipyleaflet map based on the bounding box of the image to be shown.
- dea_tools.maps.valid_data_mask(data)[source]
Calculate valid data mask array for xarray dataset.