将 GCJ-02(火星坐标系)地图瓦片实时纠正为 WGS-84 坐标系,提供标准 WMTS 服务。
uv tool install gcj-rectify或直接运行(无需安装):
uvx gcj-rectify开发模式(热重载):
uv run uvicorn gcj_rectify_server:app --reload生产模式:
uv run uvicorn gcj_rectify_server:app --host 0.0.0.0 --port 8000默认缓存目录为 ~/.cache/gcj-rectify-cache,通过环境变量 GCJRE_CACHE 可自定义:
GCJRE_CACHE=/path/to/cache uvx gcj-rectifycache.db— GCJ 原始瓦片缓存(SQLite)wgs84_cache.db— 已纠正到 WGS-84 的瓦片缓存(SQLite)maps.json— 地图配置,可编辑此文件来增删地图源
编辑缓存目录下的 maps.json 文件来增减地图源,格式如下:
{
"my-map": {
"name": "我的地图",
"url": "https://example.com/tiles/{z}/{x}/{y}.png",
"min_zoom": 3,
"max_zoom": 18
}
}