API Reference
- stacmap.explore.explore(stac: Union[ItemCollection, Catalog, List[Union[Item, Dict[str, Any]]], Item, Dict[str, Any]], *, name: Optional[str] = None, bbox: Optional[List[float]] = None, intersects: Optional[Dict[str, Any]] = None, thumbnails: bool = False, prop: Optional[str] = None, cmap: Optional[str] = None, vmin: Optional[float] = None, vmax: Optional[float] = None, categorical: bool = False, tooltip: bool = True, popup: bool = False, fields: Optional[List[str]] = None, extensions: Optional[List[str]] = None, shared_fields: bool = False, add_id: bool = True, m: Optional[folium.Map] = None, width: Optional[int] = None, height: Optional[int] = None, tiles: str = 'OpenStreetMap', attr: Optional[str] = None, zoom_to: bool = True, legend: bool = True, layer_control: bool = True, control_scale: bool = True, highlight: bool = True, style_kwds: Dict[str, Any] = {}, highlight_kwds: Dict[str, Any] = {}, bounds_kwds: Dict[str, Any] = {}, popup_kwds: Dict[str, Any] = {}, tooltip_kwds: Dict[str, Any] = {}, map_kwds: Dict[str, Any] = {}) folium.Map [source]
Explore STAC items through an interactive map.
- Parameters
stac (STAC item or collection) – STAC items to explore.
name (str, optional) – A name to assign to items in the layer control and legend. If no name is given, the collection property of the first STAC item will be used.
bbox (list of floats) – Bounding box coordinates (west, south, east, north) to overlay on the map.
intersects (dict) – GeoJSON geometry to overlay on the map.
thumbnails (bool, default False) – If true, the thumbnail asset of each item will be displayed on the map.
prop (str, optional) – The STAC property to use for color-coding items.
cmap (str, optional) – The name of a colormap to apply for color-coding. By default, only colorbrewer colors are supported. Additional colors are available if matplotlib is installed.
vmin (float, optional) – The minimum value for the color ramp. If none is given, it will be calculated from the prop.
vmax (float, optional) – The maximum value for the color ramp. If none is given, it will be calculated from the prop.
categorical (bool, default False) – If true, numeric properties are treated as categorical instead of continuous. Non-numeric properties are always treated as categorical.
tooltip (bool, default True) – If True, item metadata will be displayed on hover.
popup (bool, default False) – If True, item metadata will be displayed on click.
fields (list) – A list of metadata fields to display in the tooltip or popup. If not provided, all fields are displayed.
extensions (list) – A list of STAC extension field prefixes (like eo or proj) to include in the tooltip or popup. If not provided, all extensions will be included. Base STAC properties will be included regardless.
shared_fields (bool, default False) – If true, only fields shared by all items will be displayed in the tooltip or popup. Otherwise, missing fields will be populated with None.
add_id (bool, default True) – If true, the STAC id of each item will be added to its properties in the tooltip and popup.
m (folium.Map) – Existing
Map
instance on which to draw the plot. If none is provided, a new map will be created.width (int, optional) – Width of the map in pixels.
height (int, optional) – Height of the map in pixels.
tiles (str) – Map tileset to use, supported by
Map
.attr (str, optional) – Attribution information for custom tile sets.
zoom_to (bool, default False) – If true, the map will zoom to the bounds of the items.
legend (bool, default True) – Whether to show a legend for the color ramp.
layer_control (bool, default True) – Whether to show the layer control.
control_scale (bool, default True) – Whether to show the scale control.
highlight (bool, default True) – Whether to highlight items on hover.
style_kwds (dict, default {}) – Additional styles to be passed to the style_function of
GeoJson
. If prop is provided, color and fillColor will be set automatically and override options passed to style_kwds.highlight_kwds (dict, default {}) – Additional styles to be passed to the highlight_function of
GeoJson
.bounds_kwds (dict, default {}) – Additional styles to be passed to
GeoJson
for the bounds or intersects layers.tooltip_kwds (dict, default {}) – Additional styles to be passed to
GeoJsonTooltip
.popup_kwds (dict, default {}) – Additional styles to be passed to
GeoJsonPopup
.map_kwds (dict, default {}) – Additional styles to be passed to
Map
, if an existing map m is not given.
- Returns
The
Map
instance.- Return type
folium.Map
Examples
>>> import stacmap, pystac >>> catalog = pystac.Catalog.from_file( "https://planet.com/data/stac/disasters/hurricane-harvey/hurricane-harvey-0831/catalog.json" ) >>> stacmap.explore(catalog, prop="gsd", categorical=True)