Raster
In [1]:
Copied!
import geosdemo
import geosdemo
In [2]:
Copied!
url = "https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif"
url = "https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif"
In [3]:
Copied!
m = geosdemo.Map()
m
m = geosdemo.Map()
m
Out[3]:
In [4]:
Copied!
m.add_raster(url, name="oil_spill")
m.add_raster(url, name="oil_spill")
In [5]:
Copied!
import ipywidgets as widgets
import ipywidgets as widgets
In [6]:
Copied!
opacity_slider = widgets.FloatSlider(min=0, max=1, step=0.05, value=1)
opacity_slider
opacity_slider = widgets.FloatSlider(min=0, max=1, step=0.05, value=1)
opacity_slider
Out[6]:
In [7]:
Copied!
widgets.jslink((m.layers[-1], "opacity"), (opacity_slider, "value"))
widgets.jslink((m.layers[-1], "opacity"), (opacity_slider, "value"))
Out[7]:
Link(source=(TileLayer(attribution='', name='oil_spill', options=['attribution', 'bounds', 'detect_retina', 'max_native_zoom', 'max_zoom', 'min_native_zoom', 'min_zoom', 'no_wrap', 'tile_size', 'tms', 'zoom_offset'], url='https://titiler.xyz/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?url=https%3A%2F%2Fopendata.digitalglobe.com%2Fevents%2Fmauritius-oil-spill%2Fpost-event%2F2020-08-12%2F105001001F1B5B00%2F105001001F1B5B00.tif'), 'opacity'), target=(FloatSlider(value=1.0, max=1.0, step=0.05), 'value'))
Last update:
2023-05-10