gcoord

Use when converting coordinates between WGS84, GCJ02, BD09, BD09MC, or WebMercator coordinate systems for Chinese map services (Baidu, Amap, Google China, etc.)

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gcoord" with this command: npx skills add zhyt1985/gcoord

Gcoord - 地理坐标系转换

Overview

处理中国互联网地图坐标系不统一的问题,支持 WGS84/GCJ02/BD09/BD09MC/WebMercator 等坐标系之间的精确转换。

When to Use

digraph gcoord_flow {
    "Need to convert coordinates?" [shape=diamond];
    "Using Chinese map service?" [shape=diamond];
    "Use this skill" [shape=box];
    "Use standard tools" [shape=box];

    "Need to convert coordinates?" -> "Using Chinese map service?" [label="yes"];
    "Using Chinese map service?" -> "Use this skill" [label="yes"];
    "Using Chinese map service?" -> "Use standard tools" [label="no"];
}

Use when:

  • GPS 坐标需要显示在高德/百度/腾讯地图上
  • 从一个地图平台切换到另一个平台
  • 统一不同来源的坐标数据
  • 处理 GeoJSON 或批量坐标数据

Coordinate Systems Reference

代码中文名称别名适用平台
WGS84地球坐标系GPS, wgs84, 地球坐标GPS 设备原始坐标
GCJ02火星坐标系高德, amap, 腾讯, gcj02, 火星坐标高德地图、腾讯地图
BD09百度坐标系百度, baidu, bd09百度地图
BD09MC百度米制坐标bd09mc, 百度米制百度地图米制
WebMercator墨卡托投影墨卡托, webmercator, epsg3857Web 地图投影

Supported Input/Output Formats

格式示例说明
坐标数组[116.403988, 39.914266]JSON 数组格式
单点坐标116.403988, 39.914266逗号或空格分隔
GeoJSON{ "type": "Point", "coordinates": [...] }完整 GeoJSON 对象
批量文本每行一个坐标多行文本处理

输出格式默认与输入格式相同。

Usage Examples

Command Format

/gcoord [坐标] --from [源坐标系] --to [目标坐标系]

# 示例
/gcoord 116.403988,39.914266 --from wgs84 --to bd09
/gcoord [116.403988, 39.914266] from gps to 百度

Natural Language Format

"帮我把这个坐标转换成高德坐标系"
"GPS 坐标转百度地图"
"WGS84 转 GCJ02"

Interactive Examples

# Missing parameters - Claude will prompt
"帮我转换坐标 116.403988,39.914266"
→ Claude prompts for source and target coordinate systems

# Clear target from context
"把 116.403988,39.914266 在百度地图上显示"
→ Claude only asks for source (target is clearly BD09)

# Explicit parameters - no prompts
/gcoord 116.403988,39.914266 --from WGS84 --to BD09
→ Direct conversion, no questions asked

Interactive Parameter Selection

When to Ask User

在使用 AskUserQuestion 工具前,先尝试从用户输入中推断坐标系。只有在无法推断时才询问:

优先级判断:

  1. 命令行参数明确指定 (--from, --to)
  2. 自然语言中明确提及 (GPS、高德、百度、WGS84、GCJ02 等)
  3. 上下文推断 (文件名如 *-gcj02.geojson、前文对话)
  4. 无法推断 → 使用 AskUserQuestion

Question Format

当需要询问坐标系时,使用以下格式:

源坐标系询问:

AskUserQuestion({
  questions: [{
    question: "请选择源坐标系(您当前的坐标使用什么坐标系?)",
    header: "源坐标系",
    multiSelect: false,
    options: [
      {
        label: "WGS84 (GPS)",
        description: "GPS 设备原始坐标,地球坐标"
      },
      {
        label: "GCJ02 (高德/腾讯)",
        description: "高德地图、腾讯地图坐标系"
      },
      {
        label: "BD09 (百度)",
        description: "百度地图坐标系"
      },
      {
        label: "BD09MC (百度米制)",
        description: "百度地图米制坐标"
      },
      {
        label: "WebMercator (墨卡托)",
        description: "Web 地图投影坐标"
      }
    ]
  }]
})

目标坐标系询问:

  • 使用相同的选项
  • 修改 question 为 "请选择目标坐标系(您要转换到哪个坐标系?)"
  • header 改为 "目标坐标系"

Natural Language Recognition Patterns

在询问前,检查用户是否通过自然语言指定了坐标系:

源坐标系关键词:

  • "GPS坐标", "WGS84", "地球坐标", "原始坐标" → WGS84
  • "高德", "腾讯", "火星坐标", "gcj02" → GCJ02
  • "百度", "baidu", "bd09" → BD09
  • "墨卡托", "Web Mercator" → WebMercator

目标坐标系关键词:

  • "转成高德", "在高德地图显示", "for Amap" → GCJ02
  • "转成百度", "在百度地图显示", "for Baidu" → BD09
  • "转成GPS", "转成WGS84", "to WGS84" → WGS84

Interaction Examples

场景 1: 完全未指定

用户: 帮我转换 116.403988,39.914266

Claude:
1. 无法从输入推断源和目标坐标系
2. 询问源坐标系 → 用户选择: WGS84
3. 询问目标坐标系 → 用户选择: GCJ02
4. 调用: node index.js --input "116.403988,39.914266" --from WGS84 --to GCJ02

场景 2: 仅指定目标

用户: 把 116.403988,39.914266 在百度地图上显示

Claude:
1. 从上下文推断: 目标 = BD09 (明确)
2. 源坐标系不明确 → 询问用户
3. 用户选择: WGS84
4. 调用: node index.js --input "116.403988,39.914266" --from WGS84 --to BD09

场景 3: 明确指定(不询问)

用户: GPS转高德: 116.403988,39.914266

Claude:
1. 从自然语言识别: 源=WGS84, 目标=GCJ02
2. 直接调用: node index.js --input "116.403988,39.914266" --from WGS84 --to GCJ02

Implementation

对于精确转换,使用 index.js 脚本调用 gcoord 库:

node index.js --input "[116.403988, 39.914266]" --from WGS84 --to BD09

Common Mistakes

错误正确做法
GPS 坐标直接放百度地图先转为 BD09 坐标系
混淆经度纬度顺序始终是 [经度, 纬度]
忘记 GeoJSON 是原地修改转换后原始对象会改变

Legal Notice

使用时请遵守《中华人民共和国测绘法》和 GB 20263―2006 标准。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

GIS 校招监控

测绘/GIS 专业校招信息监控技能。使用场景:用户需要搜索、监控或定期推送测绘类、地理信息系统(GIS)专业的招聘信息时触发。支持筛选国央企、事业单位、大厂等优先级,可定时执行推送最新校招岗位。

Registry Source
1061Profile unavailable
Coding

LovTrip China Map (Amap)

高德地图助手 / Amap Map Tools for China — 地理编码、周边搜索、路线规划、地图链接生成。当用户需要中国大陆范围的地理编码、地点搜索、路线规划时使用。

Registry SourceRecently Updated
4351Profile unavailable
General

uwillberich

Build next-session A-share game plans from market structure, overnight macro shocks, policy timing, and watchlist leadership. Use when the user asks what A-s...

Registry SourceRecently Updated
2380Profile unavailable
General

考公备考追踪

朱批录 · 国考备考追踪 Skill。当用户发来套题成绩、错题截图、备考打卡或复习进度时触发。 核心功能:识别错题截图 → 分类错题原因 → 更新本地记录 → 生成每日总结 → 导出 Excel / 同步飞书。 触发关键词:做了一套题、今天做了、错了几道、帮我分析、备考打卡、行测、申论、 判断推理、资料分析、言语...

Registry SourceRecently Updated
2530Profile unavailable