Files
YunShu/skills/geocoding/SKILL.md
2026-05-08 10:12:31 +08:00

34 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: geocoding
description: 通过 wttr.in 查询城市坐标的知识和验证规则
---
# Geocoding地理编码参考
## wttr.in 坐标查询
获取城市经纬度:
```
https://wttr.in/{城市名}?format=j1
```
- 城市名支持中文(如 `北京``成都`)和英文(如 `Beijing``Chengdu`
- 返回 JSON 格式的完整天气数据,坐标在 `nearest_area[0]`
- 坐标字段:`latitude``longitude`
- 额外信息:`areaName``country``population`
## 验证规则
获取到坐标后必须验证以下信息,避免张冠李戴:
1. **确认国家/地区正确** — 检查 `country[0].value`,如"成都"的 country 应为 "China"
2. **同名城市判断** — 如果 `nearest_area` 有多条,按 population 大小取最可能的目标
3. **中文输入优先用中文查** — wttr.in 原生支持中文名解析,比先转英文更准确
4. **结果存疑时用 skill("msn-weather-api") 多看细节**
## 已知边界情况
- 小城市名可能匹配到其他国家的同名地点(如"长春"→ 印度尼西亚也有长春),需要核对 country
- 一些城市名可能有多个行政区同名(如"济南"确保是中国山东济南)
- wttr.in 是一个天气网站,它的地理编码数据偏向人口多的城市