Download images directly to a local computer
Uncomment the following line to install geemap if needed.
# !pip install -U geemap
import os
import ee
import geemap
Map = geemap.Map()
Map
image = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA").first()
Map.addLayer(image, {}, 'Landsat')
Map.centerObject(image)
geemap.download_ee_image(image, "landsat.tif", scale=100)
out_dir = os.path.expanduser('~/Downloads')
loc = ee.Geometry.Point(-99.2222, 46.7816)
collection = (
ee.ImageCollection('USDA/NAIP/DOQQ')
.filterBounds(loc)
.filterDate('2008-01-01', '2020-01-01')
.filter(ee.Filter.listContains("system:band_names", "N"))
)
geemap.download_ee_image_collection(collection, out_dir, scale=10)
Map = geemap.Map()
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003')
landsat_vis = {'bands': ['B4', 'B3', 'B2'], 'gamma': 2}
Map.addLayer(image, landsat_vis, "LE7_TOA_5YEAR/1999_2003", True, 1)
Map
region = ee.Geometry.BBox(-115.6339, 35.7529, -113.9338, 36.7012)
Map.centerObject(region)
features = geemap.fishnet(region, rows=2, cols=2)
Map.addLayer(features, {}, 'Grids')
geemap.download_ee_image_tiles(
image, features, out_dir, prefix="landsat_", crs="EPSG:3857", scale=30
)