GEE Python API

Ubuntu 上での準備

下のように GCloud を有効にして認証する.

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
sudo apt-get install google-cloud-sdk-app-engine-java google-cloud-sdk-app-engine-python google-cloud-sdk-app-engine-python-extras
gcloud init
earthengine authenticate


python3.10 のエラー回避

earthengine asset info users/username/assets_id

で assets の情報を確認できるのだが,こうすると

AttributeError: module 'collections' has no attribute 'Callable'

というエラーが出た.どうやら python3.10 だとこうなるらしい.ちゃんと確認していないので真相は不明.
collections.Callable は collections.abc.Callable になっているので,

/home/miyashita/.local/lib/python3.10/site-packages/httplib2shim/__init__.py

の中の collections.Callable を書き換えた.

    #if isinstance(proxy_info, collections.Callable):
    if isinstance(proxy_info, collections.abc.Callable):

earthengine スクリプト

Command Line Tool に色々書いてある.


Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2022-07-13 (Wed) 05:07:32 (144d)