支持selenium的simple client for earth引擎上载

geeup的Python项目详细描述


geeup:simple cli for earth engine上传selenium支持推特

doipypi version生成状态许可证

这个工具是为了处理将两个图像资产批量上载到集合的简单需要而来的,但也要感谢新的表功能,即可以将shapefile批量上载到文件夹中。尽管包括批处理图像上载程序在内的许多工具是我的另一个项目的一部分,但gee add也包括要添加到python cli的其他功能,这个工具被设计成最小的,这样用户可以简单地查询他们的配额,上传图片或表格,也可以查询正在进行的任务和删除资产。我希望这个目标简单的工具对google earth引擎的一些用户有用。

-如果您觉得此工具有用,请用星号标出并引用如下内容

Samapriya Roy. (2019, August 16). samapriya/geeup: geeup: Simple CLI for Earth Engine Uploads (Version 0.2.5). Zenodo.
http://doi.org/10.5281/zenodo.3369484

目录

安装

这假设您的系统中安装了本机python&pip,您可以通过转到终端(或windows命令提示符)并尝试

python然后pip list

如果没有错误,并且使用了Python2.7.14或更高版本,那么应该可以继续使用。请注意,我只在Python2.7.15上测试过它,但它应该在Python3上运行。

此命令行工具依赖于shapely和fiona以及因此,使用gdal中的功能 在ubuntu中安装gdal

sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
sudo apt-get install gdal-bin
sudo apt-get install python-gdal

对于Windows,我找到了这个指南

您还可以在此处安装Windows的非官方二进制文件

另外,对于ubuntu linux,我看到在安装之前这是必要的

sudo apt install libcurl4 openssl dev libssl dev

这还需要在您的系统上安装和验证土工cli并在命令行或终端中调用土工

要安装geeup:simple cli for earth engine uploads,您可以使用两种方法安装。

pip安装geeup

或者您也可以尝试

git clone https://github.com/samapriya/geeup.git
cd geeup
python setup.py install

对于Linux,请使用sudo或尝试pip install geeup--user

安装是一个可选步骤;应用程序也可以通过执行geeup.py脚本直接运行。安装它的好处是,geeup可以作为任何命令行工具执行。我建议在虚拟环境中安装。如果您不想安装,请浏览geeup文件夹,并尝试python geeup.py以获得相同的结果。

开始

如往常一样,要打印帮助:

usage: geeup.py [-h]
                {update,quota,zipshape,upload,selupload,seltabup,tasks,delete}
                ...

Simple Client for Earth Engine Uploads with Selenium Support

positional arguments:
  {update,quota,zipshape,upload,selupload,seltabup,tasks,delete}
    update              Updates Selenium drivers for firefox
    quota               Print Earth Engine total quota and used quota
    zipshape            Zips all shapefiles and subsidary files into
                        individual zip files
    getmeta             Generates generalized metadata for all rasters in folder
    upload              Batch Asset Uploader using Selenium
    seltabup            Batch Table Uploader using Selenium.
    selsetup            Non headless setup for new google account, use if upload
                        throws errors
    tasks               Queries current task status
                        [completed,running,ready,failed,cancelled]
    delete              Deletes collection and all items inside. Supports
                        Unix-like wildcards.

optional arguments:
  -h, --help            show this help message and exit

要获得特定功能的帮助,只需使用help开关调用它,例如:geeup zipshape-h。如果您没有安装geeup,那么只需转到geeup目录并运行python geeup.py[arguments go here]

geeup simple cli for earth engine上传

该工具用于处理图像和表(shapefile)的批量上载。虽然有图像集合,您可以批量上载图像,但对于矢量或形状文件,您必须将它们批量上载到文件夹中。

GEEUP初始化

这是一个关键步骤,因为所有上载功能都依赖于此步骤,因此请确保运行此步骤。这将下载selenium驱动程序并将其放置到windows和linux子系统的本地目录中。这是使用Selenium支持的上载的第一步。

geeup初始化

GEE配额

只是一个简单的工具,可以快速打印您的地球引擎配额。

usage: geeup quota [-h]

optional arguments:
  -h, --help  show this help message and exit

吉普沙佩

下面是google earth引擎中表上传的工作原理,您可以上传shp、shx、prj和dbf组件文件,也可以将这些文件压缩到一起,然后作为单个文件上传。这样做的好处是,在压缩shapefile文件之后,它会减小其总体大小,该工具会查找shp文件并找到子文件,然后将其压缩以备上载。当你有有限的上传带宽时,它也有帮助。缺点您必须创建一个文件系统的复制结构,但它可以节省带宽并自动排列您的文件,这样您就不必查找每个附加文件。

usage: geeup zipshape [-h] --input INPUT --output OUTPUT

optional arguments:
  -h, --help       show this help message and exit

Required named arguments.:
  --input INPUT    Path to the input directory with all shape files
  --output OUTPUT  Destination folder Full path where shp, shx, prj and dbf
                   files if present in input will be zipped and stored

gee getmeta

此脚本使用从gdalinfo和元数据属性解析的信息生成通用元数据。目前,它生成的元数据包括图像名称、图像的x和y维度、像素分辨率和波段数。

usage: geeup getmeta [-h] --input INPUT --metadata METADATA

optional arguments:
  -h, --help       show this help message and exit

Required named arguments.:
  --input INPUT        Path to the input directory with all raster files
  --metadata METADATA  Full path to export metadata.csv file

GEE上传

脚本从本地目录中的geotiffs创建图像集合。默认情况下,集合中的图像名称与本地目录名称相同;使用可选参数,可以提供不同的名称。

usage: geeup upload [-h] --source SOURCE --dest DEST -m METADATA
                    [--nodata NODATA] [-u USER]

optional arguments:
  -h, --help            show this help message and exit

Required named arguments.:
  --source SOURCE       Path to the directory with images for upload.
  --dest DEST           Destination. Full path for upload to Google Earth
                        Engine, e.g. users/pinkiepie/myponycollection
  -m METADATA, --metadata METADATA
                        Path to CSV with metadata.
  -u USER, --user USER  Google account name (gmail address).

Optional named arguments:
  --nodata NODATA       The value to burn into the raster as NoData (missing
                        data)

gee seltab向上

此工具允许您将表/形状文件批量下载到文件夹。在创建folde时,它使用图像上载的修改版本和围绕earthine upload cli的包装器来实现这一点。如果他们不存在,报告资产并检查上传。这只需要一个来源,目的地和您的ee认证电子邮件地址。此工具还使用selenium上载表。

usage: geeup seltabup [-h] --source SOURCE --dest DEST [-u USER]

optional arguments:
  -h, --help            show this help message and exit

Required named arguments.:
  --source SOURCE       Path to the directory with zipped folder for upload.
  --dest DEST           Destination. Full path for upload to Google Earth
                        Engine, e.g. users/pinkiepie/myponycollection
  -u USER, --user USER  Google account name (gmail address).

GEE选择设置

偶尔,geckodriver在登录到google earth引擎之前需要手动输入,此工具将允许您与googleearth引擎代码编辑器窗口的初始化进行交互。它允许用户指定要使用的帐户,并且只需要一次。

geeup selsetup

GEE任务

此脚本统计所有当前正在运行、准备就绪、已完成、失败和取消的任务以及失败的任务。此工具链接到用于初始化地球引擎客户端的google地球引擎帐户。这不需要争论。

Samapriya Roy. (2019, August 16). samapriya/geeup: geeup: Simple CLI for Earth Engine Uploads (Version 0.2.5). Zenodo.
http://doi.org/10.5281/zenodo.3369484
0

GEE删除

删除是递归的,这意味着它还将删除所有子资源:图像、集合和文件夹。小心使用!

Samapriya Roy. (2019, August 16). samapriya/geeup: geeup: Simple CLI for Earth Engine Uploads (Version 0.2.5). Zenodo.
http://doi.org/10.5281/zenodo.3369484
1

更改日志

v0.2.7

  • 修复以处理所有操作系统的case sensitive平台类型修复到问题11

v0.2.6

v0.2.5

v0.2.4

v0.2.2

v0.1.9

v0.1.8

v0.1.6

v0.1.5

v0.1.4

v0.1.3

v0.1.1

v0.0.9

v0.0.8

v0.0.7

v0.0.6

v0.0.5

v0.0.4

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spring框架服务单元测试   在Java中遍历hashmaps的hashmap以检索字符串值   如何使用CodeQL检查Java注释是否具有特定属性?   java为什么在Spring Boot中访问此资源而不是登录弹出窗口需要始终获得完全身份验证   处理将多集计数转换为列表的过程   java另一个线性布局,没有出现按钮   eclipse Java映像加载未显示在jar中   java Junit类无法加载基本测试类ApplicationContext   java如何在main中使用my getvalues()方法打印列表   java Sonar,S128:切换案例应该以无条件的“中断”语句结束,而不是继续   java从socket读取字符串错误连接重置错误   java使用新数据刷新任意图表饼图   java通过异步运行lambda访问方法参数   java错误的结果一旦我处理try and catch