import stac_ipyleaflet
= stac_ipyleaflet.StacIpyleaflet()
m m
Using the stac_ipyleaflet mapping library
Visualizing STAC Data using stac_ipyleaflet
Run This Notebook
It is recommended to run through this tutorial using VEDA’s Pangeo Notebook image, which already includes the stac_ipyleaflet library. When working within the notebook, be sure to select the nasa-veda-singleuser
kernel.
To access VEDA’s JupyterHub Environment, please refer to the “Getting access…” section of our documentation.
For reference: stac_ipyleafet repository
Import the Library & Use the Map
The stac ipyleaflet notebook’s user interface consists of a map and a custom set of tools to aid in the discovery and visualization of STAC datasets and pre-determined Basemaps.
Layers Tool
Pressing the Layers button at the top opens the Layers widget that consists of 2 tabs. This tool currently allows users to: - View Pre-defined Layers at the same time to see different combinations (currently, there are none for VEDA). - Choose between common Basemap Layers that are known favorites. - Have full control over the opacity of any layer or basemap for fine-tuning how the map looks.
The Layers Tab
- Toggle each layer’s visibility by using its checkbox
- Adjust each layer’s opacity by moving its slider
The Basemaps Tab
- Select a basemap from the dropdown
- Adjust the basemap’s opacity by moving its slider
STAC Discovery Tool
Pressing the STAC Data button at the top opens the STAC widget that consists of 2 tabs. This tool currently allows users to: - Connect to the VEDA STAC to access collections of mission data. - Discover items per the selected collection, including description, available dates, & direct URL. - Identify valid COG datasets. - Add COG tiles dynamically to the map. - Customize the tiles by changing the selected color palette for the selected item.
The Catalog Data Discovery Tab
- Select a Collection within the default STAC library.
- Browse through the Collection’s details.
- Select an item from the collection to check if it is a valid COG. If it is, the Display button will become active (available) to add the selected item to the map. The displayed STAC layer’s opacity can be adjusted by moving its slider.
The Visualization Tab
- Select a category from the dropdown.
- Select an item from the corresponding color palettes.
- Press the Display button to update the data on the map.
Interact with the Map
- Activate the Interact Tools (click on the top Interact button)
- From within the
Point
tab: Use your mouse to activate the Point tool; then click on the map at a location of interest- Coordinates will be printed within the open tab
- Raster cell values will be identified and printed, if raster layers are on
- From within the
Area
tab: Use your mouse to activate the Polygon tool; then click, hold and draw a polygon over the map - releasing to finish- The area of interest’s Coordinates & BBox within the open tab
- Alternatively Print the area of interest’s bbox from within a cell:
- Clear the point or polygon graphics as needed