← 返回 Skills 市场
jvy

geocode

作者 jvy · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ 安全检测通过
308
总下载
0
收藏
2
当前安装
5
版本数
在 OpenClaw 中安装
/install geocode
功能描述
Reverse geocode latitude/longitude to a human-readable region using geocode.com.cn. Triggers on reverse geocode, lat/lng, latitude/longitude, coordinates to...
使用说明 (SKILL.md)

geocode

Resolve coordinates back to a place name.

Provider: https://geocode.com.cn via curl.

Current root response behavior:

  • GET https://geocode.com.cn/ without params returns 400 Bad Request
  • returns field labels for Chinese and English display
  • demo: https://geocode.com.cn/?lat=39.9042&lon=116.4074

Quick Start

{baseDir}/scripts/geocode.sh hint
{baseDir}/scripts/geocode.sh reverse 32.9042 110.805 --lang zh-CN
{baseDir}/scripts/geocode.sh reverse 37.819929 -122.478255 --lang en

When to Use

  • "Reverse geocode 32.9042, 110.805"
  • "Coordinates to address"
  • "根据经纬度查地点"
  • "把经纬度转成地址"

When NOT to Use

  • Address/place name to coordinates (forward geocoding): use another provider
  • Rich place details, reviews, opening hours, or POI metadata: use goplaces
  • Routing, distance matrices, or navigation
  • High-volume batch geocoding

Query Rules

  • Pass decimal latitude and longitude.
  • The endpoint supports reverse geocoding only via GET /?lat=\x3Clatitude>&lon=\x3Clongitude>.
  • A bare root request returns a field-label hint payload describing the reverse-geocode result columns.
  • accept-language may still be passed, but the documented contract on the site only guarantees lat and lon.

Config

  • GEOCODE_BASE_URL optionally points at another endpoint for testing or self-hosting.
  • GEOCODE_USER_AGENT overrides the default identifying User-Agent.

Public API Limits

  • Use public endpoints only for low-frequency, interactive lookups.
  • Send an identifying User-Agent; do not use default curl UA for repeated calls.
  • Do not loop, bulk geocode, or aggressively retry against the public endpoint.

Commands

Scripted Reverse Geocode

{baseDir}/scripts/geocode.sh reverse 32.9042 110.805 --lang zh-CN
{baseDir}/scripts/geocode.sh reverse 37.819929 -122.478255 --lang en

Raw Reverse Geocode

curl --get 'https://geocode.com.cn/' \
  -A 'openclaw-geocode-skill/1.0 (interactive use)' \
  --data 'lat=32.9042' \
  --data 'lon=110.805'

Scripted Root Hint

{baseDir}/scripts/geocode.sh hint

Raw Root Hint Response

curl -iL 'https://geocode.com.cn/'

Current response body:

{
  "demo": "https://geocode.com.cn/?lat=25.7433&lon=123.4733",
  "zh": ["国家/地区", "省", "市", "县", "乡镇/街道"],
  "en": ["Country", "admin1", "admin2", "", "name"]
}

Response Shape

Successful responses return a compact JSON array, not an object. The root hint now documents five display fields instead of the old six-field output description.

Fixed order mapping:

  • index 0: Country / 国家/地区
  • index 1: admin1 /
  • index 2: admin2 /
  • index 3: county-level field when present /
  • index 4: name / 乡镇/街道

Example:

["CN", "Taiwan Province", "Yilan County", "Toucheng Township", ""]

What to Return

  • The original coordinates
  • Best available locality/region text assembled from name, county, admin2, and admin1
  • Country or region value when present
  • A note that some positions may be empty, especially the county or name slot over water or remote areas
  • A short note if any fields are empty

Notes

  • The bundled script prints raw JSON to stdout and keeps dependencies to curl only.
  • search is intentionally unsupported because geocode.com.cn explicitly says it only supports GET /?lat=\x3Clatitude>&lon=\x3Clongitude>.
  • If the user needs address-to-coordinate lookup, switch to a forward-geocoding provider instead of this endpoint.
安全使用建议
This skill appears to do exactly what it says: small bash script that issues GET requests to https://geocode.com.cn/ to reverse-geocode coordinates. Before installing, note that (1) the script makes outbound HTTPS requests to the provider — don't pass sensitive coordinates you don't want sent to that service, (2) GEOCODE_BASE_URL can be set to point to another host (use only trusted endpoints), and (3) respect the provider's usage guidance (no bulk/batched high-volume lookups). No secrets or broad system access are requested.
功能分析
Type: OpenClaw Skill Name: geocode Version: 1.0.4 The geocode skill is a legitimate utility for reverse geocoding coordinates using the geocode.com.cn API. The bash script (scripts/geocode.sh) includes proper input validation for latitude and longitude using regex, uses safe argument passing for curl to prevent injection, and follows standard configuration patterns via environment variables. No evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description are consistent with the included script and SKILL.md. The only required binary is curl (declared), and optional env vars (GEOCODE_BASE_URL, GEOCODE_USER_AGENT) are directly relevant to choosing the endpoint and user-agent.
Instruction Scope
SKILL.md and scripts instruct only to call the provider's root or reverse endpoint and to assemble a short response. The script does not read unrelated files, does not attempt to access other credentials, and does not transmit data to unexpected endpoints by default. Note: the user-configurable GEOCODE_BASE_URL means a user (or operator) could point requests at a different host, which would then receive coordinates — this is expected behavior but worth being aware of.
Install Mechanism
No install spec; this is an instruction-only skill with one small bash script bundled. Nothing is downloaded or extracted at install time.
Credentials
The skill requires no credentials and only optionally honors GEOCODE_BASE_URL and GEOCODE_USER_AGENT. The requested environment access is minimal and proportional to the stated function.
Persistence & Privilege
The skill is user-invocable, not always-enabled, and does not request persistent or elevated privileges or modify other skills or system settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install geocode
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /geocode 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Root API hint response now describes a five-field display format (previously six fields). - Chinese and English field labels are included in the hint response for improved clarity. - Response mapping updated: now structured as [Country, admin1, admin2, county, name]. - Documentation reflects these API updates and clarifies which fields may be empty, especially for remote or ambiguous locations. - No code changes; this update is documentation only.
v1.0.3
- Updated documentation to clarify the required API parameters and current error message for root endpoint usage. - Added explicit guidance on using GET /?lat=<latitude>&lon=<longitude>, including demo and hint commands. - Expanded response array documentation with new indices, now including normalized coordinates. - Provided examples of error and success responses from the current API. - Removed homepage field from metadata for consistency with service capabilities.
v1.0.2
**Reverse geocoding only; forward geocoding removed.** - Now supports only reverse geocoding (coordinates to place name) using geocode.com.cn. - All forward geocoding triggers, logic, and documentation removed; use another provider for address-to-coordinates. - Updated documentation to clarify accepted triggers, examples, and API limits. - Response is now a compact array with a fixed order for place name, region, and country code. - Notes and usage sections streamlined to reflect the new single-focus functionality.
v1.0.1
- Switched geocoding provider reference from Nominatim/OpenStreetMap API to geocode.com.cn in documentation and examples. - Updated service description and homepage URL to match the new provider. - Adjusted usage recommendations, config, and usage limits to reflect generic/public endpoints instead of Nominatim-specific details. - Example raw curl commands now point to the new provider for reverse geocoding; forward search examples still reference Nominatim as illustration. - No file changes detected in code; this update concerns documentation only.
v1.0.0
Initial release: convert place names/addresses to coordinates (and vice versa) using the public Nominatim (OpenStreetMap) API via curl. - Supports both forward and reverse geocoding. - Triggers on multiple English and Chinese keywords for geocoding tasks. - Includes command-line and raw curl examples for usage. - Geocoding results are returned as JSON; latitude, longitude, and normalized place names provided. - Usage guidelines clarify when to use or avoid the skill and note public API limits.
元数据
Slug geocode
版本 1.0.4
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 5
常见问题

geocode 是什么?

Reverse geocode latitude/longitude to a human-readable region using geocode.com.cn. Triggers on reverse geocode, lat/lng, latitude/longitude, coordinates to... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 308 次。

如何安装 geocode?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install geocode」即可一键安装,无需额外配置。

geocode 是免费的吗?

是的,geocode 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

geocode 支持哪些平台?

geocode 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 geocode?

由 jvy(@jvy)开发并维护,当前版本 v1.0.4。

💬 留言讨论