-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
144 lines (126 loc) · 6.28 KB
/
Copy pathconfig.example.yaml
File metadata and controls
144 lines (126 loc) · 6.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# GeoVerse Map Server 示例配置
# 用法: geoverse -config config.yaml
server:
host: 0.0.0.0
port: 8080
cors: true
timeout: 30s
# base_url: https://maps.example.com # 反向代理场景下的外部地址
cache:
enabled: true
max_entries: 10000 # 进程内 LRU 缓存的切片条数上限(一级缓存)
ttl: 5m
disk: # 磁盘二级缓存:重启后依然有效,按 mtime 过期
enabled: false
dir: ./tile-cache
ttl: 24h
max_size_mb: 512 # 超限时后台清理,按最旧优先淘汰;0 = 不限制
auth: # 简单 API Key 鉴权(/health、/readyz 豁免)
enabled: false
api_keys: [] # 也可用环境变量 GEOVERSE_API_KEYS=key1,key2 追加
# 客户端可用三种方式携带 key:
# Authorization: Bearer <key> / X-API-Key: <key> / ?api_key=<key>
mcp: # Model Context Protocol 端点(Streamable HTTP)
enabled: false # 开启后 LLM 智能体可通过 /mcp 发现图层、查询要素
path: /mcp
# 本地文件数据源安全边界。root 是允许目录,不改变 source.path 的相对路径语义。
assets:
root: ./examples/data
enforce_root: true
max_file_size_mb: 8192 # MBTiles / PMTiles 等文件的统一上限;0 = 不限制
max_memory_file_size_mb: 256 # GeoJSON / GeoPackage 加载到内存前的更严格上限
# PostGIS / MySQL 数据源的 schema/table 白名单,与账号自身权限相互独立的
# 第二层保护——账号能读到的表里,只有列在这里的才会被真正注册成对外图层。
# 两个列表都省略时保持兼容行为(账号能读到的表都可注册),由 doctor 提醒。
# data_sources:
# allowed_schemas: [geo, public]
# allowed_tables: [geo.feature, public.roads]
# require_readonly_role: true # 仅影响 `-doctor` 输出:探测账号在目标表上
# # 是否持有超出 SELECT 的权限,探测失败按
# # 信息提示处理,不算 warning,不会阻止启动
sources:
# ── 数据库:PostGIS 动态矢量切片(需要 PostGIS >= 3.0)──────────
# 与 WebUI「填入本地 PostgreSQL 示例」一致;请按本机库名/账号/表名修改。
# - name: local-postgis
# type: postgis
# title: 本地 PostGIS 示例
# dsn: postgres://postgres:postgres@127.0.0.1:5432/postgres
# table: public.features
# geometry_column: geom # 默认 geom
# id_column: id # 缺省时自动探测主键;UUID/text 可作 OGC ID,MVT feature id 仅使用整数列
# srid: 4326 # 缺省时从 geometry_columns 探测
# fields: [name, class] # 缺省时导出全部非几何列
# min_zoom: 0
# max_zoom: 22
# ── 数据库:MySQL 8 / MariaDB 空间表(动态 MVT + Features)────
# WebUI「填入本地 MySQL / MariaDB 示例」对应 deploy compose 的 mysql profile:
# 宿主 3308 → 容器 3306,库 geoverse_demo,表 warehouse,几何列 location。
# - name: local-mysql
# type: mysql
# title: 本地 MySQL 8 空间表示例
# dsn: mysql://geoverse_reader:geoverse_demo@127.0.0.1:3308/geoverse_demo
# table: geoverse_demo.warehouse
# geometry_column: location # 默认 geom
# id_column: id # 缺省时自动探测主键
# srid: 4326 # 缺省时从首个非空几何探测
# fields: [name, address] # 缺省时导出全部非几何列
# min_zoom: 0
# max_zoom: 22
# ── 静态文件:预切好的 MBTiles(矢量 pbf 或 png/jpg/webp 栅格)──
# - name: basemap
# type: mbtiles
# path: ./data/basemap.mbtiles
# ── 静态文件:PMTiles v3(推荐的大型只读归档)────────────────
# - name: vector_basemap
# type: pmtiles
# path: ./data/vector-basemap.pmtiles
# # 同时提供:
# # /tiles/vector_basemap/{z}/{x}/{y}.pbf 服务端解包切片
# # /archives/vector_basemap.pmtiles 浏览器 Range/206 直读
# ── 静态文件:GeoJSON(启动时载入内存,动态切片 + 要素服务)────
- name: cities
type: geojson
path: ./examples/data/cities.geojson
title: 中国主要城市
max_zoom: 14
# 以下两个图层来自 Natural Earth(公有领域),获取渠道与更多
# 开放数据源见 docs/OPEN_DATA.md
- name: countries
type: geojson
path: ./examples/data/ne_110m_admin_0_countries.geojson
title: 世界国家边界(Natural Earth 1:110m)
max_zoom: 8
- name: places
type: geojson
path: ./examples/data/ne_110m_populated_places_simple.geojson
title: 世界主要城市(Natural Earth 1:110m)
max_zoom: 10
# 步行路网示例:室外街区网格 + 两层室内走廊(入口坡道/电梯连接体),
# 供下方 networks 构建可路由图
- name: campus_paths
type: geojson
path: ./examples/data/campus_paths.geojson
title: 校园步行路网示例
max_zoom: 18
# ── 静态文件:OGC GeoPackage ────────────────────────────────
# - name: parcels
# type: geopackage
# path: ./data/parcels.gpkg
# layer: parcels # gpkg 内只有一个要素表时可省略
# 可路由网络:由某个要素源的 LineString 构建图,供路由类算法使用。
# 多层室内:要素带 level 属性即在该层;带 level_from/level_to 的要素是
# 跨层连接体(楼梯/电梯/入口),可用 duration_s 指定固定通行耗时。
networks:
- name: campus
source: campus_paths
default_speed_kmh: 5 # 步行速度
# speed_field: speed_kmh # 每条线的速度属性(可选)
# oneway_field: oneway # 单行线属性(可选)
# 空间算法端点(默认开启):GET /algorithms 列出全部能力,
# POST /algorithms/{name} 执行;开启 MCP 后同时暴露为 algo_* 工具
algorithms:
enabled: true
# 启动后访问 http://localhost:8080/admin/ 可打开内置控制台的数据源、服务目录与
# 运行统计三视图。
# WebUI 会先真实探活,再原子写回本文件并热加载数据源;若配置以只读卷挂载,
# 页面自动降级为只读。对外部署务必开启 auth 或由反向代理限制 /admin/*。