WGS84
Use this skill for practical work with WGS 84 longitude/latitude coordinates.
WGS 84 usually refers to the global geographic reference system commonly exposed as EPSG:4326 in GIS software. It is the right default for GPS-style coordinate exchange, but it is not the right answer for every display or measurement workflow.
What This Skill Does
- - Explain what WGS 84 is and when to use it.
- Validate longitude/latitude numeric ranges.
- Check whether a coordinate pair is likely
lon,lat or lat,lon. - Recommend a UTM zone and EPSG code for projected analysis.
- Flag when a coordinate falls inside mainland-China extents where
GCJ-02 / BD-09 confusion is common. - Recommend whether to keep WGS84, use Web Mercator for display, or switch to a projected CRS for analysis.
- Explain when to keep data in
EPSG:4326 and when to reproject. - Hand off file-based reprojection steps to
qgis when execution is required.
Standard Workflow
- 1. Confirm whether the input is WGS 84 already, or just "GPS coordinates" by assumption.
- State the expected tuple order explicitly:
lon,lat or lat,lon. - Validate numeric ranges before discussing conversion.
- Decide the task type:
- storage or API exchange
- web map display
- distance/area/buffer analysis
- regional engineering or survey workflow
- 5. Keep
EPSG:4326 for exchange/storage unless the task needs projected units. - If analysis needs meters, recommend a suitable projected CRS such as a local CRS or UTM zone.
Practical Commands
Validate a WGS84 coordinate pair
CODEBLOCK0
Check whether a pair is probably lon,lat or lat,lon
CODEBLOCK1
Recommend a UTM zone and EPSG code from WGS84 coordinates
CODEBLOCK2
Flag China mapping offset risk
CODEBLOCK3
Recommend the right CRS for a concrete task
CODEBLOCK4
Decision Rules
- - Prefer
EPSG:4326 for interoperable storage, APIs, logs, and exchange. - Prefer a projected CRS in meters for buffering, area, distance, and nearest-neighbor analysis.
- Prefer
EPSG:3857 only for web-map display compatibility, not for accurate measurement. - Do not assume a pair is WGS 84 just because it contains two decimals; confirm source system when accuracy matters.
- Do not assume all systems interpret
EPSG:4326 axis order the same way; many practical APIs use lon,lat even when standards prose differs. - In mainland China workflows, explicitly check whether the source is raw WGS84 or app-level
GCJ-02 / BD-09. - Treat
GCJ-02 and BD-09 as mapping offset systems, not simple aliases for EPSG:4326.
What To Return
- - The interpreted coordinate order.
- Whether the values are valid WGS84 longitude/latitude ranges.
- Whether keeping
EPSG:4326 is appropriate for the task. - If not, recommend the target CRS and explain why.
- If using UTM, provide zone number, hemisphere, and EPSG code.
- If the point is in mainland China, include a short warning about
GCJ-02 / BD-09 ambiguity when relevant.
When Not To Use
- - Reverse geocoding or coordinates to address lookup: use
geocode. - File-based GIS conversion or batch reprojection: use
qgis. - General CRS comparison beyond WGS84-centered guidance: use
project. - Navigation routing, POI search, or map reviews.
OpenClaw + ClawHub Notes
- - Keep examples generic and reproducible.
- Do not hardcode private paths, real device traces, or private datasets.
- For clawhub.ai publication, keep versioning/changelog semver-driven and examples standards-based.
Reference Docs In This Skill
- - Read
{baseDir}/references/wgs84-reference.md for concise CRS comparison and common failure cases.
WGS84
使用此技能进行WGS 84经度/纬度坐标的实际工作。
WGS 84通常指全球地理参考系统,在GIS软件中常以EPSG:4326形式呈现。它是GPS坐标交换的默认正确选择,但并非适用于所有显示或测量工作流程。
此技能的功能
- - 解释什么是WGS 84以及何时使用它。
- 验证经度/纬度数值范围。
- 检查坐标对是lon,lat还是lat,lon格式。
- 为投影分析推荐UTM区域和EPSG代码。
- 标记坐标是否落入中国大陆范围内(该区域常出现GCJ-02/BD-09混淆)。
- 建议保留WGS84、使用Web Mercator显示,或切换到投影CRS进行分析。
- 解释何时将数据保留在EPSG:4326中,以及何时进行重投影。
- 在需要执行时,将基于文件的重投影步骤移交给qgis。
标准工作流程
- 1. 确认输入是否已经是WGS 84,还是仅凭假设认为是GPS坐标。
- 明确说明预期的元组顺序:lon,lat或lat,lon。
- 在讨论转换前验证数值范围。
- 确定任务类型:
- 存储或API交换
- 网络地图显示
- 距离/面积/缓冲区分析
- 区域工程或测量工作流程
- 5. 除非任务需要投影单位,否则为交换/存储保留EPSG:4326。
- 如果分析需要米制单位,推荐合适的投影CRS,如本地CRS或UTM区域。
实用命令
验证WGS84坐标对
bash
python3 {baseDir}/scripts/wgs84_tool.py validate --lon 116.4074 --lat 39.9042
检查坐标对是lon,lat还是lat,lon
bash
python3 {baseDir}/scripts/wgs84_tool.py guess-order --a 116.4074 --b 39.9042
python3 {baseDir}/scripts/wgs84_tool.py guess-order --a 39.9042 --b 116.4074
从WGS84坐标推荐UTM区域和EPSG代码
bash
python3 {baseDir}/scripts/wgs84_tool.py utm --lon 116.4074 --lat 39.9042
python3 {baseDir}/scripts/wgs84_tool.py utm --lon -122.478255 --lat 37.819929
标记中国地图偏移风险
bash
python3 {baseDir}/scripts/wgs84_tool.py china-check --lon 116.4074 --lat 39.9042
为具体任务推荐合适的CRS
bash
python3 {baseDir}/scripts/wgs84_tool.py recommend --lon 116.4074 --lat 39.9042 --task exchange
python3 {baseDir}/scripts/wgs84_tool.py recommend --lon 116.4074 --lat 39.9042 --task analysis
python3 {baseDir}/scripts/wgs84_tool.py recommend --lon 116.4074 --lat 39.9042 --task web-map
决策规则
- - 对于可互操作的存储、API、日志和交换,优先使用EPSG:4326。
- 对于缓冲、面积、距离和最近邻分析,优先使用以米为单位的投影CRS。
- 仅为了网络地图显示兼容性才使用EPSG:3857,不用于精确测量。
- 不要仅因为坐标对包含两个小数就假定它是WGS 84;当精度重要时,确认源系统。
- 不要假设所有系统以相同方式解释EPSG:4326轴顺序;许多实际API使用lon,lat,即使标准文本可能不同。
- 在中国大陆工作流程中,明确检查源是原始WGS84还是应用级别的GCJ-02/BD-09。
- 将GCJ-02和BD-09视为地图偏移系统,而非EPSG:4326的简单别名。
返回内容
- - 解释的坐标顺序。
- 数值是否为有效的WGS84经度/纬度范围。
- 保留EPSG:4326是否适合该任务。
- 如果不适合,推荐目标CRS并解释原因。
- 如果使用UTM,提供区域编号、半球和EPSG代码。
- 如果点位于中国大陆,在相关时包含关于GCJ-02/BD-09歧义的简短警告。
何时不使用
- - 反向地理编码或坐标转地址查询:使用geocode。
- 基于文件的GIS转换或批量重投影:使用qgis。
- 超出WGS84中心指导的通用CRS比较:使用project。
- 导航路线规划、POI搜索或地图评论。
OpenClaw + ClawHub 说明
- - 保持示例通用且可重现。
- 不要硬编码私有路径、真实设备轨迹或私有数据集。
- 对于clawhub.ai发布,保持版本控制/变更日志遵循语义化版本,示例基于标准。
此技能中的参考文档
- - 阅读{baseDir}/references/wgs84-reference.md以获取简洁的CRS比较和常见失败案例。