fusion table到ee tables cli
ft2gee的Python项目详细描述
ft2gee:fusion table to ee tables cli
将google drive和google earth引擎脚本中的所有fusion表转换为google earth引擎表。该工具是谷歌Fusion Tables在2019年底服务结束后的产物,虽然这段时间可能有迁移选项可用,但对于某些工作流来说,可能需要更早、更一致地移出Fusion Table环境。这需要创建具有读取权限的google drive api凭据文件,才能在google驱动器上运行该文件,并且您可以找到更多detailed tutorial here。
目录
安装
这假设您的系统中安装了本机python&pip,您可以通过转到终端(或windows命令提示符)并尝试
python
然后pip list
如果没有错误,并且使用了Python2.7.14或更高版本,那么应该可以继续使用。请注意,我只在Python2.7.15上测试过它,但它应该在Python3上运行。
要安装ft2gee:simple cli for google home&mini可以使用两种方法安装。
pip install ft2gee
或者您也可以尝试
git clone https://github.com/samapriya/ft2gee.git
cd ft2gee
python setup.py install
对于Linux,请使用sudo或尝试pip install ft2gee --user
。
安装是一个可选步骤;应用程序也可以通过执行ft2gee.py脚本直接运行。安装它的好处是ft2gee可以作为任何命令行工具执行。我建议在虚拟环境中安装。如果不想安装,请浏览ft2gee文件夹并尝试python ft2gee.py
以获得相同的结果。
开始
如往常一样,要打印帮助:
usage: ft2gee [-h] [--auth_host_name AUTH_HOST_NAME]
[--noauth_local_webserver]
[--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]]
[--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
{quota,drive2tab,gee2tab,scriptcheck} ...
Fusion table to EE tables CLI
positional arguments:
{quota,drive2tab,gee2tab,scriptcheck}
quota Print Earth Engine total quota and used quota
drive2tab Exports Google Drive Fusion tables to Earth Engine
tables
gee2tab Exports Earth Engine referenced fusion tables to Earth
Engine tables
scriptcheck Replaces referenced fusion tables in Earth Engine
scripts to EE tables
optional arguments:
-h, --help show this help message and exit
--auth_host_name AUTH_HOST_NAME
Hostname when running a local web server.
--noauth_local_webserver
Do not run a local web server.
--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]
Port web server should listen on.
--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Set the logging level of detail.
要获得特定功能的帮助,只需使用help开关调用它,例如:ft2gee gee2tab -h
。如果您没有安装ft2gee,那么您可以通过转到ft2gee目录并运行python ft2gee.py [arguments go here]
来运行它。忽略主程序的可选参数,因为它们是带有google api的oauth步骤的结果。
ft2gee fusion table到ee tables cli
<>这个工具被设计为在谷歌驱动器和你的地球引擎脚本中使用现有的融合表,并将它们导出到地球引擎表中。这时,它们可以进一步导出为shapefile或geojson等。配额
只是一个简单的工具来快速打印你的地球引擎配额。
usage: ft2gee quota [-h]
optional arguments:
-h, --help show this help message and exit
驱动2tab
这要求您创建一个google驱动器凭据文件,您可以在自述文件开头的medium教程中获得相关说明。此工具将使用您的凭据授予您访问驱动器中所有Fusion表的权限,并将所有这些表导出到地球引擎文件夹。
usage: ft2gee drive2tab [-h] --gee GEE [--credentials CREDENTIALS]
optional arguments:
-h, --help show this help message and exit
Required named arguments.:
--gee GEE Path to Google Earth Engine asset folder for tables to
be exported
Optional named arguments:
--credentials CREDENTIALS
Credentials file downloaded for gdrive
gee2tab
此工具旨在通过google earth引擎代码进行解析,您可以从Earth Engine Git Repo下载这些代码。一旦你下载了你的文件,你可以把它指向一个文件夹,它会用一个fusion表解析所有的行,并将它们导出到一个地球引擎文件夹。
usage: ft2gee gee2tab [-h] --local LOCAL --gee GEE
optional arguments:
-h, --help show this help message and exit
Required named arguments.:
--local LOCAL Local path to folder with Google Earth Engine Scripts
--gee GEE Path to Google Earth Engine asset folder for tables to be
exported
脚本检查
这仍在开发中,但想法是,一旦您将所有的fusion表导出到一个earth engine文件夹中,您就可以指向一个脚本并为它提供文件夹路径,它将用google表路径替换fusion表路径。目前,它生成一个文件,文件名中添加了'\u ft',脚本编写的当前时间为。它目前只为一个脚本而设计,但可以用于文件夹中的所有脚本。
usage: ft2gee scriptcheck [-h] --local LOCAL --gee GEE
optional arguments:
-h, --help show this help message and exit
Required named arguments.:
--local LOCAL Local path to a Google Earth Engine Script to check
--gee GEE Earth Engine folder where EE tables were exported