# exportags2 **Repository Path**: cubic8/exportags2 ## Basic Information - **Project Name**: exportags2 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-15 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ArcGIS Feature Service Exporter ArcGIS Feature Service 导出工具,支持导出到 Shapefile 和 PostGIS,支持定时同步。 ## 快速开始 ### 1. 构建镜像 ```bash docker build -t arcgis-exporter . ``` ### 2. 导出为 Shapefile ```bash docker run --rm -v $(pwd)/output:/output arcgis-exporter to-shp ``` ### 3. 导入 PostGIS ```bash docker run --rm \ -e POSTGIS_HOST=localhost \ -e POSTGIS_PASSWORD=secret \ arcgis-exporter to-postgis ``` ### 4. 启动定时同步(北京时间) ```bash docker run -d \ --name arcgis-sync \ -e SCHEDULE_ENABLED=true \ -e POSTGIS_PASSWORD=secret \ -e SCHEDULE_CRON="0 2 * * *" \ -v $(pwd)/logs:/app/logs \ arcgis-exporter schedule ``` ## 环境变量 | 变量 | 说明 | 默认值 | |------|------|--------| | SERVICE_URL | ArcGIS 服务地址 | World_Cities | | POSTGIS_HOST | 数据库主机 | localhost | | POSTGIS_PASSWORD | 数据库密码 | 必需 | | POSTGIS_TABLE | 目标表名 | world_cities | | POSTGIS_MODE | 导入模式: replace/append/update | replace | | SCHEDULE_ENABLED | 启用定时任务 | false | | SCHEDULE_CRON | Cron 表达式 | 0 2 * * * | | TZ | 时区 | Asia/Shanghai | ## 命令参考 | 命令 | 说明 | |------|------| | to-shp | 导出为 Shapefile | | to-postgis | 导入 PostGIS(覆盖+校验) | | schedule | 启动定时同步 | | schedule --run-once | 测试执行一次 | | validate | 校验现有数据 | | info | 查看服务信息 | ## Cron 表达式(北京时间) | 需求 | 表达式 | |------|--------| | 每天凌晨2点 | 0 2 * * * | | 每6小时 | 0 */6 * * * | | 每周一8:30 | 30 8 * * 1 | | 每月1号 | 0 0 1 * * | ## Docker Compose 使用 ```bash # 启动 PostGIS docker-compose up -d postgis # 运行导出 docker-compose run --rm exporter to-postgis # 启动定时任务 docker-compose up -d scheduler # 查看日志 docker-compose logs -f scheduler ```