python
然后pip list
如果没有错误,并且使用了Python2.7.14或更高版本,那么应该可以继续使用。请注意,我只在Python2.7.15上测试过它,但是可以很容易地为Python3修改它。
要安装python cli for digital ocean,可以使用两种方法安装
pip安装gee2drive
或者您也可以尝试
git clone https://github.com/samapriya/gee2drive.git
cd gee2drive
python setup.py install
使用可能需要使用sudo权限
安装是一个可选步骤;应用程序也可以通过执行gee2drive.py脚本直接运行。安装它的好处是可以作为任何命令行工具执行ppipe。我建议在虚拟环境中安装。如果不想安装,请浏览gee2drive文件夹,并尝试使用python gee2drive.py获得相同的结果。
开始
如往常一样,要打印帮助:
usage: gee2drive [-h] {terminal,refresh,idsearch,bandtype,export} ...
Google Earth Engine to Drive Exporter
positional arguments:
{terminal,refresh,idsearch,bandtype,export}
terminal Starts the interactive terminal with autosuggest
refresh Refreshes your personal asset list and GEE Asset list
idsearch Does possible matches using asset name to give you
asseth id/full path
bandtype Prints bandtype and generates list to be used for
export
export Export Collections based on filter
optional arguments:
-h, --help show this help message and exit
要获得特定功能的帮助,只需使用help开关调用它,例如:gee2drive idsearch-h
。如果您没有安装gee2drive,那么只需转到gee2drive目录并运行python gee2drive.py[参数在这里]
gee到google drive cli
此工具旨在使用cli扩展现有的图像导出功能,通过此功能,您可以根据感兴趣的区域geojson文件(集合的开始和结束日期)将参数传递给filter
GEE2drive终端
这是一个自动建议终端,它使用gee2add软件包来执行所有功能,但具有autosuggest for earth engine目录和您自己的个人目录。这样,您就无需在javascript代码编辑器中输入目录id即可访问图像id。
usage: gee2drive terminal [-h]
optional arguments:
-h, --help show this help message and exit
输入gee2drive terminal
后,您将在当前终端中获得一个外壳,在该外壳中,您可以获得图像的自动建议,并具有终端的全部功能。
gee2drive刷新
在过去的几个月里,我在他们的栅格数据目录中维护了最新google earth引擎资产的目录。我每周都更新这个名单。此工具下载此列表的最新版本,并查看您的个人资产以生成您自己的资产报告,然后作为主数据集提供给自动建议。
gee2drive refresh -h
usage: gee2drive refresh [-h]
optional arguments:
-h, --help show this help message and exit
gee2drive idsearch
有一种可能是你没有真正记住你的资产或公共资产的完整路径。幸运的是,当我为您解析和收集图像列表和路径时,它们的名称是可搜索的,因此请使用关键字。例如,使用"modis"或"sentinel"进行搜索。而且它不区分大小写,所以您应该能够键入"sentinel"或"sentinel"或"sentinel",并且它应该仍然有效
gee2drive idsearch -h
usage: gee2drive idsearch [-h] [--name NAME]
optional arguments:
-h, --help show this help message and exit
--name NAME Name or part of name to search for
Gee2Drive相交
此工具允许您导出地球引擎数据集列表中存在的每个资产以及与之相交的个人资产的报告
你的几何。该工具希望您提供开始和结束日期以及要筛选的几何图形。该工具使用bounds()函数来使用边界框,以防几何体具有复杂的几何体或顶点过多,只需使用运算符bb
。如果geojson/json/kml一直给出解析错误,请转到geojson.io
usage: gee2drive intersect [-h] [--start START] [--end END] [--aoi AOI]
[--report REPORT] [--operator OPERATOR]
optional arguments:
-h, --help show this help message and exit
--start START Start date to filter image
--end END End date to filter image
--aoi AOI Full path to geojson/json/kml to be used for bounds
--report REPORT Full path where the report will be exported including
type, path & number of intersects
Optional named arguments for geometry only:
--operator OPERATOR Use bb for Bounding box incase the geometry is complex
or has too many vertices
GEE2drive波段类型
导出要求所有带宽类型都是同一类型的。为此,我只需为您生成波段类型,您可以选择所需的波段列表,请记住将其粘贴为列表。
usage: gee2drive bandtype [-h] [--id ID]
optional arguments:
-h, --help show this help message and exit
--id ID full path for collection or image
GEE2drive导出
最后是导出工具,它允许您将图像或剪辑到aoi的集合导出。这将利用您导出的带宽列表。如果导出的是图像而不是集合,则不需要开始和结束日期。该工具使用bounds()函数来使用边界框,以防几何体具有复杂的几何体或顶点过多,只需使用运算符bb
。如果geojson/json/kml一直给出解析错误,请转到geojson.io
usage: gee2drive export [-h] [--id ID] [--type TYPE] [--folder FOLDER]
[--aoi AOI] [--start START] [--end END]
[--bandlist BANDLIST] [--operator OPERATOR]
optional arguments:
-h, --help show this help message and exit
--id ID Full path for collection or image
--type TYPE Type whether image or collection
--folder FOLDER Drive folder path
--aoi AOI Full path to geojson/json/kml to be used for bounds
Optional named arguments for image collection only:
--start START Start date to filter image
--end END End date to filter image
--bandlist BANDLIST Bandlist we generated from bandtype export must be same
bandtype
--operator OPERATOR Use bb for Bounding box incase the geometry is complex
or has too many vertices
典型的设置是
--bandlist ['B2','B3','B4'] --operator "bb" --type "collection"
同样,正如前面所承诺的,有一种方法可以添加额外的过滤器,然后通过导出函数传递它这里是如何将其包含在examples文件夹中的。例如,此示例使用Landsat集合,但在将其传递给导出之前应用云覆盖过滤器
git clone https://github.com/samapriya/gee2drive.git
cd gee2drive
python setup.py install
0
更改日志
v0.0.6
- 现在导出与几何图形和日期范围相交的所有资产的报告
- 小修和一般改进
v0.0.4
- 现在可以解析gejson、json、kml
- 小修和一般改进
v0.0.3
欢迎加入QQ群-->: 979659372
推荐PyPI第三方库