地球观测数据接入网关

eodag的Python项目详细描述


eodag

https://badge.fury.io/py/eodag.svghttps://readthedocs.org/projects/pip/badge/?version=latest&style=flathttps://mybinder.org/badge_logo.svg

EODAG(地球观测数据访问网关)是一个命令行工具和面向插件的Python搜索框架, 聚合结果并下载遥感图像,同时为数据访问提供统一的API,而不管 数据提供程序。eodag sdk围绕三个功能构建:

  • List product types: list of supported products and their description
  • Search products (by product type or uid) : searches products according to the search criteria provided
  • Download products : download product “as is”

eodag是用python开发的。它是根据模块化的插件架构构建的,易于扩展,能够 整合新的数据提供者。工具由三种插件组成:

  • Catalog search plugins, responsible for searching data (OpenSearch, CSW, …), building paths, retrieving quicklook, combining results
  • Download plugins, allowing to download and retrieve data locally (via FTP, HTTP, ..), always with the same directory organization
  • Authentication plugins, which are used to authenticate the user on the external services used (JSON Token, Basic Auth, OAUTH, …).

阅读the documentation了解更多信息。

安装

eodag打开PyPI

python -m pip install eodag

用法

命令行界面

从存储库提供的模板user_conf_template.yml创建配置文件,填充 在每个提供程序所期望的凭据中(注意,现在需要此配置文件)。然而,这 将来会改变的)。

然后就可以开始玩了:

  • 搜索产品并压缩搜索结果:

    eodag search \
    --conf my_conf.yml \
    --box 1 43 2 44 \
    --start 2018-01-01 \
    --end 2018-01-31 \
    --cloudCover 20 \
    --productType S2_MSI_L1C
    --cruncher FilterLatestIntersect \
    --storage my_search.geojson
    

上面的请求搜索产品类型,并使用cruncherfilterlatestintersect 并将整个结果存储到my_search.geojson

通过这样做,您可以在命令行上将参数传递给cruncher(例如使用filteroverlapcruncher 它采用最小重叠作为参数:

eodag search -f my_conf.yml -b 1 43 2 44 -s 2018-01-01 -e 2018-01-31 -p S2_MSI_L1C \
             --cruncher FilterOverlap \
             --cruncher-args FilterOverlap minimum_overlap 10

上面的请求意味着:“给我所有s2_msi_l1c类型的产品,使用filteroverlap只保留这些产品 包含在我给你的bbox中,或者空间范围与表面重叠至少10%(最小重叠)。 这个盒子的“

  • 要下载以前调用搜索的结果:

    eodag download --conf my_conf.yml --search-results my_search.geojson
    
  • 列出所有可用的产品类型和支持的提供商:

    eodag list
    
  • 要列出指定的受支持提供程序上的可用产品类型:

    eodag list -p sobloo
    
  • 要查看所有可用的选项和命令:

    eodag --help
    
  • 要打印日志消息,请将-v添加到eodagmaster命令。例如,eodag-v list。给定的(最多3个)越多 工具太冗长了。对于完整的详细输出,请执行以下操作:例如:eodag -vvv list

rest api

eodag安装可以通过rest api从命令行公开:

# eodag serve-rest --help
Usage: eodag serve-rest [OPTIONS]

  Start eodag HTTP server

Options:
  -f, --config PATH   File path to the user configuration file with its
                      credentials  [required]
  -d, --daemon TEXT   run in daemon mode
  -w, --world         run flask using IPv4 0.0.0.0 (all network interfaces),
                      otherwise bind to 127.0.0.1 (localhost). This maybe
                      necessary in systems that only run Flask  [default:
                      False]
  -p, --port INTEGER  The port on which to listen  [default: 5000]
  --debug             Run in debug mode (for development purpose)  [default:
                      False]
  --help              Show this message and exit.

python api

在python代码中与api交互的示例用法:

fromeodagimportEODataAccessGatewaydag=EODataAccessGateway()product_type='S2_MSI_L1C'footprint={'lonmin':1,'latmin':43.5,'lonmax':2,'latmax':44}start,end='2018-01-01','2018-01-31'search_results=dag.search(productType=product_type,box=footprint,start=start,end=end)product_paths=dag.download_all(search_results)forpathinproduct_paths:print('Downloaded : {}'.format(path))

贡献

如果您打算贡献给eodag源代码:

git clone https://bitbucket.org/geostorm/eodag.git
cd eodag
python -m pip intall -r requirements-dev.txt
pre-commit install

运行默认测试套件(不包括端到端测试):

tox

注意

您可能会遇到一个pythonruntimewarning表示numpy.dtype大小已更改。如果是这样的话, 在运行测试或eodag cli之前,可以通过在命令行上执行此操作来抑制它: 导出pythonwarnings=“ignore:numpy.dtype size changed”

仅运行端到端测试:

tox -- tests.test_end_to_end

运行整个测试(单元、集成和端到端):

tox -- tests eodag

注意

运行tox命令也将生成文档。作为文件 包括一些笔记本(用于turorials),构建过程将需要 pandoc成功。如果生成过程失败 你,请install潘多克试试 再一次。

注意

eodag是针对python版本2.7、3.5和3.6进行测试的。确保你有 在运行tox之前安装了这些版本。你可以用 pyenv管理许多不同的版本 python的

发布是通过标记COM麻省理工学院主科。要制作新版本,

  • Ensure you correctly updated README.rst and CHANGES.rst (and occasionally, also NOTICE - in case a new dependency is added).
  • Check that the version string in eodag/__meta__.py (the variable __version__) is correctly updated
  • Push your local master branch to remote. That will trigger the bitbucket pipeline that runs the unit tests.
  • Tag the commit that represents the state of the release with a message. For example, for version 1.0, do this: git tag -a v1.0 -m ‘version 1.0’
  • Push the tags to bitbucket: git push –tags. This will trigger a build on bitbucket pipelines that will do the release automatically.

文档由webhook管理,关于readthedocs的最新文档如下 master中提供的文档。因此,除了更新,没有其他事情可做 要发布最新文档的母版分支。

许可证

eodag是根据apache license v2.0授权的。 有关详细信息,请参见许可证文件。

作者

eodag是由cs sys_mes d'information开发的。

学分

eodag建立在非常有用的开源项目之上。有关这些项目和 他们的执照。 感谢所有这些项目的作者!

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

推荐PyPI第三方库


热门话题
c#Java Tcp服务器和。Net Tcp客户端的发送和接收问题   安卓应用程序上的java标记地理位置,其位置位于我周围5Km半径范围内。   向java添加对话框并检索html文件   当eclipse甚至无法打开时,java会在eclipse中更改不兼容的JVM   java中同一jframe中的jlabel和paintComponent   基于另一数组排序的java排序   java AADSTS7000012:该补助金是为另一个租户获得的   java在JSF中使用foreach循环   java如何通过maven为运行junit测试创建运行配置?   java Selenium webDriver不稳定错误堆栈跟踪   java有没有办法创建以键为大写的JSON对象?