1.基于吴秋生老师的GEE入门教程在miniconda中下载python3.8版本;
2.打开Anaconda Prompt(miniconda)中输入:
conda create -n gee python=3.8 自定义环境名 python=python版本
conda deactivate gee 激活环境 自定义环境名
conda install mamba -c conda-forge 通过使用-c conda-forge渠道安装 Mamba
conda install geemap -c conda-forge
4.配置代理服务器
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
这里输入自己电脑的端口
3.输入conda install -c gee earthengine-api 安装Google的python API客户端
4.earthengine authenticate 验证GEE账户
5.测试本地环境是否搭建完成
#导入gee库
import ee
import os
#设置网络代理端口,7890为自己的端口号
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:7890'
#验证账号
# ee.Authenticate()
#初始化
ee.Initialize()
image1 = ee.Image('srtm90_v4')
path = image1.getDownloadUrl({
'scale': 30,
'crs': 'EPSG:4326',
'region': '[[-120, 35], [-119, 35], [-119, 34], [-120, 34]]'
})
# 获取下载地址
print(path)