Earthengine intro
In [1]:
import ee
import geodatatool
In [2]:
Map = geodatatool.Map()
Map
In [3]:
geodatatool.ee_initialize()
In [4]:
dem = ee.Image('USGS/SRTMGL1_003')
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}
In [5]:
ee_layer = geodatatool.ee_tile_layer(dem, vis_params, "DEM")
In [6]:
Map.add_layer(ee_layer)
In [7]:
# alternate name can be used for Map.add_layer, conventional to JavaScript
# Map.addLayer(dem, vis_params, "DEM")
In [8]:
import ipywidgets as widgets
In [9]:
slider = widgets.FloatSlider(min=0, max=1, step=0.01)
slider
In [10]:
widgets.jslink((ee_layer, "opacity"), (slider, "value"))
Link(source=(TileLayer(attribution='Google Earth Engine', name='DEM', options=['attribution', 'detect_retina',…
In [11]:
from ipyleaflet import WidgetControl
In [12]:
control = WidgetControl(widget=slider, position="bottomright")
Map.add_control(control)
In [ ]:
Last update: 2021-05-07