Uncomment the following line to install geemap if needed.
# !pip install geemap
To follow this tutorial, you need to sign up for an account with https://datapane.com, then install and authenticate the datapane
Python package. More information can be found here.
pip install datapane
datapane login
datapane ping
import ee
import geemap.foliumap as geemap
Map = geemap.Map(center=[40, -100], zoom=4)
# Select the seven NLCD epoches after 2000.
years = ['2001', '2004', '2006', '2008', '2011', '2013', '2016']
# Get an NLCD image by year.
def getNLCD(year):
# Import the NLCD collection.
dataset = ee.ImageCollection('USGS/NLCD_RELEASES/2016_REL')
# Filter the collection by year.
nlcd = dataset.filter(ee.Filter.eq('system:index', year)).first()
# Select the land cover band.
landcover = nlcd.select('landcover')
return landcover
for year in years:
data = getNLCD(year)
Map.addLayer(data, {}, 'NLCD ' + year)
# Add the NLCD legend to the map.
Map.add_legend(legend_title='NLCD Land Cover Classification', builtin_legend='NLCD')
Map
Map.publish(name='National Land Cover Database (NLCD)')