Cloud free composite
In [ ]:
import ee
import geemap
In [ ]:
Map = geemap.Map()
Map
In [ ]:
states = ee.FeatureCollection('TIGER/2018/States')
TN = states.filter(ee.Filter.eq("NAME", "Tennessee"))
Map.addLayer(TN, {}, "Tennessee")
In [ ]:
years = ee.List.sequence(2013, 2020)
years.getInfo()
In [ ]:
def yearly_image(year):
start_date = ee.Date.fromYMD(year, 1, 1)
end_date = start_date.advance(1, "year")
collection = ee.ImageCollection('LANDSAT/LC08/C01/T1') \
.filterDate(start_date, end_date) \
.filterBounds(TN)
image = ee.Algorithms.Landsat.simpleComposite(collection).clipToCollection(TN)
return image
In [ ]:
images = years.map(yearly_image)
In [ ]:
vis_params = {'bands': ['B5', 'B4', 'B3'], 'max': 128}
In [ ]:
for index in range(0, 8):
image = ee.Image(images.get(index))
layer_name = "Image " + str(index + 2013)
Map.addLayer(image, vis_params, layer_name)
Last update: 2021-03-17