136 download parallel
Downloading Earth Engine images in parallel
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install -U geemap geedim
# !pip install -U geemap geedim
In [ ]:
Copied!
import ee
import geemap
import ee
import geemap
Add a Landsat imagery to the map
In [ ]:
Copied!
Map = geemap.Map(center=[40, -100], zoom=4)
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003').select(['B4', 'B3', 'B2'])
Map.addLayer(image, {'min': 20, 'max': 200, 'gamma': 2.0}, 'Landsat')
Map
Map = geemap.Map(center=[40, -100], zoom=4)
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003').select(['B4', 'B3', 'B2'])
Map.addLayer(image, {'min': 20, 'max': 200, 'gamma': 2.0}, 'Landsat')
Map
Specify a region of interest.
In [ ]:
Copied!
region = ee.Geometry.BBox(-112.5439, 34.0891, -85.0342, 49.6858)
Map.addLayer(region, {}, 'ROI')
Map.centerObject(region)
region = ee.Geometry.BBox(-112.5439, 34.0891, -85.0342, 49.6858)
Map.addLayer(region, {}, 'ROI')
Map.centerObject(region)
Create a fishnet.
In [ ]:
Copied!
fishnet = geemap.fishnet(region, h_interval=4.0, v_interval=4.0, delta=0.5)
fishnet = geemap.fishnet(region, h_interval=4.0, v_interval=4.0, delta=0.5)
Add the fishnet to the map.
In [ ]:
Copied!
style = {'color': 'ffff00ff', 'fillColor': '00000000'}
Map.addLayer(fishnet.style(**style), {}, 'Fishnet')
style = {'color': 'ffff00ff', 'fillColor': '00000000'}
Map.addLayer(fishnet.style(**style), {}, 'Fishnet')
Download images by the fishnet cells in parallel.
In [ ]:
Copied!
geemap.download_ee_image_tiles_parallel(
image, fishnet, out_dir='tiles', scale=1000, crs='EPSG:3857')
geemap.download_ee_image_tiles_parallel(
image, fishnet, out_dir='tiles', scale=1000, crs='EPSG:3857')
The parallel downloading above takes ~10 seconds. The serial downloading below takes ~60 seconds.
In [ ]:
Copied!
geemap.download_ee_image_tiles(
image, fishnet, out_dir='tiles', scale=1000, crs='EPSG:3857'
)
geemap.download_ee_image_tiles(
image, fishnet, out_dir='tiles', scale=1000, crs='EPSG:3857'
)
Last update:
2023-06-22
Created: 2023-06-14
Created: 2023-06-14