47 image thumbnails
Uncomment the following line to install geemap if needed.
In [1]:
Copied!
# !pip install geemap
# !pip install geemap
How to download image thumbnails from an ImageCollection¶
In [2]:
Copied!
import os
import ee
import geemap
import os
import ee
import geemap
In [3]:
Copied!
Map = geemap.Map()
Map = geemap.Map()
In [4]:
Copied!
roi = ee.Geometry.Point([-122.44, 37.75])
collection = (
ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(roi)
.sort("CLOUD_COVER")
.limit(10)
)
image = collection.first()
roi = ee.Geometry.Point([-122.44, 37.75])
collection = (
ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(roi)
.sort("CLOUD_COVER")
.limit(10)
)
image = collection.first()
In [5]:
Copied!
vis_params = {
'bands': ['B6', 'B5', 'B4'],
'min': 0,
'max': 6000,
'gamma': 1.4,
}
Map.addLayer(image, vis_params, "LANDSAT 7")
Map.setCenter(-122.44, 37.75, 8)
Map
vis_params = {
'bands': ['B6', 'B5', 'B4'],
'min': 0,
'max': 6000,
'gamma': 1.4,
}
Map.addLayer(image, vis_params, "LANDSAT 7")
Map.setCenter(-122.44, 37.75, 8)
Map
Out[5]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [6]:
Copied!
out_img = os.path.expanduser("~/Downloads/landsat.png")
out_img = os.path.expanduser("~/Downloads/landsat.png")
In [7]:
Copied!
geemap.get_image_thumbnail(image, out_img, vis_params, dimensions=500, format='png')
geemap.get_image_thumbnail(image, out_img, vis_params, dimensions=500, format='png')
In [8]:
Copied!
geemap.show_image(out_img)
geemap.show_image(out_img)
In [9]:
Copied!
out_dir = os.path.expanduser("~/Downloads")
out_dir = os.path.expanduser("~/Downloads")
In [10]:
Copied!
geemap.get_image_collection_thumbnails(
collection, out_dir, vis_params, dimensions=500, format="jpg"
)
geemap.get_image_collection_thumbnails(
collection, out_dir, vis_params, dimensions=500, format="jpg"
)
Total number of images: 10 Downloading 1/10: LC08_044034_20151116.jpg ... Downloading 2/10: LC08_044034_20150305.jpg ... Downloading 3/10: LC08_044034_20180225.jpg ... Downloading 4/10: LC08_044034_20190924.jpg ... Downloading 5/10: LC08_044034_20210321.jpg ... Downloading 6/10: LC08_044034_20130923.jpg ... Downloading 7/10: LC08_044034_20130409.jpg ... Downloading 8/10: LC08_044034_20141012.jpg ... Downloading 9/10: LC08_044034_20130416.jpg ... Downloading 10/10: LC08_044034_20140318.jpg ...
Last update:
2022-03-14