GEE Python API: не удается отобразить изображение

Я пытался устранить неполадки с помощью Python API в GEE, но я просто не могу понять проблему. Я искал на форумах аналогичную проблему, но решения, которые я нашел, не помогли с проблемой.

Я сейчас пытаюсь просто показать изображение в Google Colab. Мой код следующий:

**# Get image collection**
sentinel_collection = ee.ImageCollection('COPERNICUS/S2_SR')
**# Filter by bates**
collection_time = sentinel_collection.filterDate('2017-03-28', '2019-12-08')
**# Create a square over region of interest**
square = ee.Geometry.Rectangle(coords=[
                                       [-77.04931434943427,-12.11990118945657],
                                       [-76.98579963996161,-12.09103199034111]],
                                        proj=None)

collection_bounds = collection_time.filterBounds(square)
**# Filter to remove clouds that have > 5% cover**
clouds = collection_bounds.filter(ee.Filter.lt('CLOUD_COVER', 5))
**# Select appropriate bands**
bands = clouds.select(['B4', 'B3', 'B2'])
**# Create a composite image**
composite = bands.median()
**# Show the image**
Image(url=composite.getThumbUrl({'min':0,'max': 3000}))

Я считаю, что мой процесс фильтрации и выбора в порядке, пока я не вызываю метод getThumbnail:

Image(url=composite.getThumbUrl({'min':0,'max': 3000}))

Код ошибки, который я получаю, - это общая ошибка 500, которая совершенно бесполезна:

    ---------------------------------------------------------------------------
HttpError                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/ee/data.py in _execute_cloud_call(call, num_retries)
    337   try:
--> 338     return call.execute(num_retries=num_retries)
    339   except apiclient.errors.HttpError as e:

7 frames
HttpError: <HttpError 500 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/thumbnails?fields=name&alt=json returned "An internal error has occurred">

During handling of the above exception, another exception occurred:

EEException                               Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/ee/data.py in _execute_cloud_call(call, num_retries)
    338     return call.execute(num_retries=num_retries)
    339   except apiclient.errors.HttpError as e:
--> 340     raise _translate_cloud_exception(e)
    341 
    342 

EEException: An internal error has occurred

Я долго оглядывался, пытаясь понять, в чем проблема, но, честно говоря, понятия не имею. Я пробовал разные варианты фильтрации перед вызовом метода getThumbNail, но безуспешно.

Любая помощь приветствуется!


person user2647734    schedule 14.12.2019    source источник


Ответы (1)


Смотрите документацию здесь.

https://developers.google.com/earth-engine/image_visualization

Внизу страницы написано:

Note: getThumbURL is intended as a method for producing preview images
you might include in presentations, websites, and social media posts. 
Its size limitation is 100,000,000 pixels and the browser can timeout 
for complicated requests. 

If you want a large image or have a complex process, see the Exporting Data page.

Итак, ваше изображение, вероятно, слишком велико. Попробуйте уменьшить его или используйте экспорт данных (или для Python).

person korakot    schedule 16.12.2019