26 heroku
Uncomment the following line to install geemap if needed.
In [1]:
Copied!
# !pip install geemap
# !pip install geemap
In [2]:
Copied!
import ee
import geemap
import ee
import geemap
Earth Engine App¶
In [3]:
Copied!
Map = geemap.Map(center=(40, -100), zoom=4)
Map = geemap.Map(center=(40, -100), zoom=4)
In [4]:
Copied!
# Add Earth Engine dataset
dem = ee.Image('USGS/SRTMGL1_003')
landcover = ee.Image("ESA/GLOBCOVER_L4_200901_200912_V2_3").select('landcover')
landsat7 = ee.Image('LE7_TOA_5YEAR/1999_2003')
states = ee.FeatureCollection("TIGER/2018/States")
# Set visualization parameters.
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],
}
# Add Earth Eninge layers to Map
Map.addLayer(
landsat7, {'bands': ['B4', 'B3', 'B2'], 'min': 20, 'max': 200}, 'Landsat 7'
)
Map.addLayer(landcover, {}, 'Land cover')
Map.addLayer(dem, vis_params, 'SRTM DEM', True, 1)
Map.addLayer(states, {}, "US States")
Map
# Add Earth Engine dataset
dem = ee.Image('USGS/SRTMGL1_003')
landcover = ee.Image("ESA/GLOBCOVER_L4_200901_200912_V2_3").select('landcover')
landsat7 = ee.Image('LE7_TOA_5YEAR/1999_2003')
states = ee.FeatureCollection("TIGER/2018/States")
# Set visualization parameters.
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],
}
# Add Earth Eninge layers to Map
Map.addLayer(
landsat7, {'bands': ['B4', 'B3', 'B2'], 'min': 20, 'max': 200}, 'Landsat 7'
)
Map.addLayer(landcover, {}, 'Land cover')
Map.addLayer(dem, vis_params, 'SRTM DEM', True, 1)
Map.addLayer(states, {}, "US States")
Map
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [5]:
Copied!
print('Change layer opacity:')
dem_layer = Map.layers[-2]
dem_layer.interact(opacity=(0, 1, 0.1))
print('Change layer opacity:')
dem_layer = Map.layers[-2]
dem_layer.interact(opacity=(0, 1, 0.1))
Change layer opacity:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Input In [5], in <cell line: 2>() 1 print('Change layer opacity:') ----> 2 dem_layer = Map.layers[-2] 3 dem_layer.interact(opacity=(0, 1, 0.1)) AttributeError: 'Map' object has no attribute 'layers'
Last update:
2022-03-14