|
5 일 전 | |
---|---|---|
Cd_Prediction_Integrated_System | 6 일 전 | |
Water | 1 주 전 | |
app | 5 일 전 | |
data | 2 달 전 | |
docs | 1 주 전 | |
migrations | 6 일 전 | |
scripts | 5 일 전 | |
ssl | 2 달 전 | |
.gitignore | 1 주 전 | |
PROJECT_RULES.md | 1 주 전 | |
README.md | 1 주 전 | |
alembic.ini | 3 달 전 | |
db_migrate.py | 3 주 전 | |
enviroment.yml | 1 주 전 | |
main.py | 6 일 전 | |
package-lock.json | 3 주 전 | |
package.json | 3 주 전 | |
soilgd.dump | 3 주 전 |
这是一个基于 FastAPI 开发的地图数据处理系统,支持栅格和矢量数据的处理、存储和管理。
app/
├── api/ # API 路由层
│ ├── raster.py # 栅格数据接口
│ ├── vector.py # 矢量数据接口
│ └── unit_grouping.py # 单元分类接口
├── services/ # 业务逻辑层
│ ├── raster_service.py
│ ├── vector_service.py
│ └── unit_grouping_service.py # 单元分类服务
├── models/ # 数据模型
├── utils/ # 工具函数
├── database.py # 数据库配置
└── main.py # 主程序入口
docs/
├── features/ # 功能文档
│ └── unit-grouping/
│ └── README.md # 单元分类功能说明
tests/
├── integration/ # 集成测试
│ └── test_unit_grouping.py
scripts/
├── demos/ # 演示脚本
│ └── unit_grouping_demo.py
└── ...
项目提供了专门的环境导出脚本,用于管理和分享环境配置:
# 导出当前环境(包含conda显式安装包和pip包)
python scripts/demos/conda_env_export_tool.py -e GeoSys -o environment.yml
# 查看帮助
python scripts/demos/conda_env_export_tool.py --help
功能特点:
安装 Anaconda/Miniconda
创建项目环境
# 使用项目提供的环境文件
conda env create -f enviroment.yml
# 激活环境
conda activate GeoSys
修改 config.env
文件中的数据库连接信息:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=your_database
DB_USER=your_username
DB_PASSWORD=your_password
创建数据库:
createdb -U postgres data_db
导入数据库备份:
pg_restore -U postgres -d data_db soilgd.sql
验证数据库连接:
psql -U postgres -d data_db -c "\dt"
导出导入指定数据库
# 导出(生成可被pg_restore恢复的文件)
pg_dump -U postgres -Fc data_db > soilgd.sql
# 导入(恢复上面生成的文件)
pg_restore -U postgres -d data_db soilgd.sql
启动服务:
uvicorn app.main:app --reload
快速演示单元分类功能:
python scripts/demos/unit_grouping_demo.py
访问 API 文档:
Swagger UI: http://localhost:8000/docs
ReDoc: http://localhost:8000/redoc