giswqs / earthengine-py-notebooks

A collection of 360+ Jupyter Python notebook examples for using Google Earth Engine with interactive mapping
https://gishub.org/geemap-notebooks
MIT License
1.38k stars 406 forks source link

Export landset image... #10

Closed lovechang1986 closed 2 years ago

lovechang1986 commented 2 years ago

Hello, professor,

I want to use your GEEMAP library to export pictures. There are 300 examples in your tutorial. I am a bit confused and I don’t know how to use Google Earth.

Can you give some suggestions based on the picture I gave and which examples should I use?

There are two key points:

  1. Add label of localtion, like A in the pic.
  2. Display the image acquisition time.

Thank you very much. 20211122113953

Another question: I use this script in jupyterlab, there are some error..

image = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_038029_20180810')

landsat_vis = {
    'bands': ['B4', 'B3', 'B2'], 
    'gamma': 1.4
}
Map.addLayer(image, landsat_vis, "LE7_TOA_5YEAR/1999_2003", True, 0.7)
# Draw any shapes on the map using the Drawing tools before executing this code block
feature = Map.draw_last_feature

if feature is None:
    geom = ee.Geometry.Polygon([[[-115.413031, 35.889467],
    [-115.413031, 36.543157],
    [-114.034328, 36.543157],
    [-114.034328, 35.889467],
    [-115.413031, 35.889467]]])
    feature = ee.Feature(geom, {})

roi = feature.geometry()
import os
out_dir = os.path.join('/root/Downloads')
filename = os.path.join(out_dir, 'landsat.tif')
geemap.ee_export_image(image, filename=filename, scale=90, region=roi, file_per_band=True)

Error like this:

Generating URL ...
An error occurred while downloading.
Total request size (42441000 bytes) must be less than or equal to 33554432 bytes.
giswqs commented 2 years ago

As the error message indicates, the file size exceeds the limit enforced by GEE. You need to export large images to Google Drive. https://geemap.org/notebooks/11_export_image/#export-an-image-to-google-drive