stackstac.show#
- stackstac.show(arr, center=None, zoom=None, range=None, cmap=None, checkerboard=True, interpolation='linear', **map_kwargs)#
Quickly create an
ipyleaflet.Map
displaying aDataArray
.As you pan around the map, the part of the array that’s in view is computed on the fly by dask. This requires using a dask distributed cluster.
- Parameters:
DataArray
to visualize. Must havex
andy
, and optionallyband
dims, and theepsg
coordinate set.arr
must have 1-3 bands. Single-band data can be colormapped; multi-band data will be displayed as RGB. For 2-band arrays, the first band will be duplicated into the third band’s spot, then shown as RGB.center – Centerpoint for the map, in (lat, lon) order. If None (default), the map will automatically be centered on the array.
zoom – Initial zoom level for the map. If None (default), a zoom level to fit the array on a reasonably-sized map is picked.
range (
Optional
[Tuple
[float
,float
]]) –Min and max values in
arr
which will become black (0) and white (255) in the visualization.If None (default), it will automatically use the 2nd/98th percentile values of the entire array (unless it’s a boolean array; then we just use 0-1). For large arrays, this can be very slow and expensive, and slow down tile rendering a lot, so passing an explicit range is usually a good idea.
cmap (
Union
[str
,Colormap
,None
]) –Colormap to use for single-band data. Can be a matplotlib colormap name as a string, or a
Colormap
object for custom colormapping.If None (default), the default matplotlib colormap (usually
viridis
) will automatically be used for 1-band data. Setting a colormap for multi-band data is an error.checkerboard (
bool
) –Whether to show a checkerboard pattern for missing data (default), or leave it fully transparent.
Note that only NaN is considered a missing value; any custom fill value should be converted to NaN before visualizing.
interpolation (
Literal
[‘linear’, ‘nearest’]) – Interpolation method to use while reprojecting:"linear"
or"nearest"
(default"linear"
). Use"linear"
for continuous data, such as imagery, SAR, DEMs, weather data, etc. Use"nearest"
for discrete/categorical data, such as classification maps.
- Returns:
The new map showing this array.
- Return type: