首页
/ Planetary Computer APIs 项目使用教程

Planetary Computer APIs 项目使用教程

2025-04-17 03:16:56作者:范垣楠Rhoda

1. 项目的目录结构及介绍

Planetary Computer APIs 是一个开源项目,其目录结构如下:

.
├── .github/                # GitHub 相关配置文件
├── auxiliary/              # 辅助脚本和配置
├── deployment/             # 部署相关的配置和脚本
├── docs/                   # 项目文档
├── nginx/                  # NGINX 配置文件
├── pccommon/               # Planetary Computer 公共模块
├── pcfuncs/                # Planetary Computer 函数模块
├── pcstac/                 # Planetary Computer STAC API 模块
├── pctiler/                # Planetary Computer Tiler 模块
├── pgstac/                 # PostgreSQL STAC 模块
├── scripts/                # 项目构建和测试脚本
├── .flake8                 # Flake8 Python 代码风格检查配置
├── .gitignore              # Git 忽略文件
├── .isort.cfg              # isort Python 代码排序配置
├── CHANGELOG.md            # 项目更新日志
├── CODE_OF_CONDUCT.md      # 项目行为准则
├── LICENSE                 # 项目许可证
├── README.md               # 项目说明文件
├── SECURITY.md             # 项目安全策略
├── SUPPORT.md              # 项目支持说明
├── azure-pipelines.yml     # Azure pipelines 配置
├── docker-compose.dev.yml  # Docker Compose 开发环境配置
├── docker-compose.yml      # Docker Compose 配置
├── mypy.ini                # MyPy Python 类型检查配置
├── pc-funcs.dev.env         # Planetary Computer 函数开发环境配置
├── pc-stac.dev.env          # Planetary Computer STAC API 开发环境配置
├── pc-tiler.dev.env         # Planetary Computer Tiler 开发环境配置
├── pytest.ini              # Pytest 测试配置
├── requirements-dev.txt    # 开发环境依赖

每个目录和文件的作用如下:

  • .github/:存放 GitHub Actions 工作流文件等。
  • auxiliary/:包含辅助脚本和配置文件,如代理配置等。
  • deployment/:包含在 Azure 云环境中部署服务的相关配置和脚本。
  • docs/:存放项目的文档。
  • nginx/:包含 NGINX 服务的配置文件。
  • pccommon/:包含 Planetary Computer 的公共模块代码。
  • pcfuncs/:包含 Planetary Computer 的 Azure 函数模块。
  • pcstac/:包含 Planetary Computer STAC API 的代码。
  • pctiler/:包含 Planetary Computer Tiler 的代码。
  • pgstac/:包含 PostgreSQL STAC 相关的代码。
  • scripts/:包含项目的构建、测试和部署脚本。
  • 其他文件:包括代码风格、Git 忽略规则、许可证、项目说明等。

2. 项目的启动文件介绍

项目的启动主要依赖于 scripts 目录下的脚本,以下是主要启动文件的介绍:

  • setup:用于初始化项目,包括构建 Docker 容器、应用数据库迁移和加载开发数据。
  • update:用于在项目代码更新后,重新构建 Docker 镜像。
  • server:用于启动本地开发环境中的所有服务,包括数据库、STAC API、Tiler、Azure Functions 等。
  • test:用于运行项目的测试用例。

3. 项目的配置文件介绍

项目的配置主要通过以下文件进行:

  • docker-compose.yml:定义了项目所需的 Docker 服务,包括数据库、应用服务器等。
  • docker-compose.dev.yml:定义了开发环境中使用的 Docker 服务配置,可能包括额外的服务或不同的环境变量。
  • .env 文件:在 auxiliary/ 目录下的 .env 文件包含了开发环境中的环境变量设置,如数据库连接信息、API 密钥等。

这些配置文件是项目运行过程中不可或缺的部分,确保了项目在不同环境下的一致性和稳定性。

登录后查看全文
热门项目推荐