118 download image
Download images directly to a local computer
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install -U geemap
# !pip install -U geemap
In [ ]:
Copied!
import os
import ee
import geemap
import os
import ee
import geemap
In [ ]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
Download a single image¶
In [ ]:
Copied!
image = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA").first()
Map.addLayer(image, {}, 'Landsat')
Map.centerObject(image)
image = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA").first()
Map.addLayer(image, {}, 'Landsat')
Map.centerObject(image)
In [ ]:
Copied!
geemap.download_ee_image(image, "landsat.tif", scale=100)
geemap.download_ee_image(image, "landsat.tif", scale=100)
Download an image collection¶
In [ ]:
Copied!
out_dir = os.path.expanduser('~/Downloads')
out_dir = os.path.expanduser('~/Downloads')
In [ ]:
Copied!
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"))
)
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"))
)
In [ ]:
Copied!
geemap.download_ee_image_collection(collection, out_dir, scale=10)
geemap.download_ee_image_collection(collection, out_dir, scale=10)
Download image by tile¶
In [ ]:
Copied!
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
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
In [ ]:
Copied!
region = ee.Geometry.BBox(-115.6339, 35.7529, -113.9338, 36.7012)
Map.centerObject(region)
region = ee.Geometry.BBox(-115.6339, 35.7529, -113.9338, 36.7012)
Map.centerObject(region)
In [ ]:
Copied!
features = geemap.fishnet(region, rows=2, cols=2)
Map.addLayer(features, {}, 'Grids')
features = geemap.fishnet(region, rows=2, cols=2)
Map.addLayer(features, {}, 'Grids')
In [ ]:
Copied!
geemap.download_ee_image_tiles(
image, features, out_dir, prefix="landsat_", crs="EPSG:3857", scale=30
)
geemap.download_ee_image_tiles(
image, features, out_dir, prefix="landsat_", crs="EPSG:3857", scale=30
)
Last update:
2023-04-06
Created: 2020-03-31
Created: 2020-03-31