← 返回
未分类 中文

Openstreet Map

Use when you need OpenStreetMap geocoding or annotated map generation for a set of places.
当需要使用OpenStreetMap进行地理编码或为一组地点生成标注地图时使用。
poxenstudio
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 402
下载
💾 1
安装
1
版本
#latest

概述

OpenStreet Map Skill (for OpenClaw)

This skill provides two capabilities:

  1. Query one place's location information.
  2. Render an annotated map image for multiple places with numbered markers and a legend.

Prerequisites

  • Python 3.10+
  • Internet access (Nominatim + OSM tile endpoints)

Optional environment variable:

  • OPENSTREET_MAP_HOST: Override only the openstreetmap.org host suffix in the default endpoints. Recommended form: openstreetmap.org. If http:// or https:// is provided, only the host part is used.

When set, the skill uses:

  • Geocode endpoint: https://nominatim.${OPENSTREET_MAP_HOST}/search
  • Tile endpoint: https://tile.${OPENSTREET_MAP_HOST}/{z}/{x}/{y}.png

Examples:

  • OPENSTREET_MAP_HOST=openstreetmap.org -> https://nominatim.openstreetmap.org/search
  • OPENSTREET_MAP_HOST=https://openstreetmap.org -> https://tile.openstreetmap.org/{z}/{x}/{y}.png

Install

pip install -r requirements.txt

Capability 1: Query location info

python tools/openstreet_skill.py locate --query "The Bund Shanghai" --limit 1

Output is JSON including display_name, lat, lon, and type metadata.

Capability 2: Render annotated map

Input JSON file format (array):

[
  {"name": "Point A", "lat": 31.2304, "lon": 121.4737},
  {"name": "Point B", "query": "The Bund Shanghai"}
]

Render command:

python tools/openstreet_skill.py render \
  --points-file examples/points.json \
  --output output/annotated_map.png \
  --width 1600 \
  --height 800

Render command with base64 JSON input:

python tools/openstreet_skill.py render \
  --points-base64 "W3sibmFtZSI6IlBvaW50IEEiLCJsYXQiOjMxLjIzMDQsImxvbiI6MTIxLjQ3Mzd9LHsibmFtZSI6IlBvaW50IEIiLCJxdWVyeSI6IlRoZSBCdW5kIFNoYW5naGFpIn1d" \
  --output output/annotated_map.png

Optional: render command returning base64-encoded image (no file written):

python tools/openstreet_skill.py render \
  --points-base64 "..." \
  --base64

Optional: render command writing file and returning base64:

python tools/openstreet_skill.py render \
  --points-base64 "..." \
  --output output/annotated_map.png \
  --base64

render input/output options:

  • --points-file / --points-base64: points source (mutually exclusive, one required).
  • --output: save image to path. This is the default and recommended output mode.
  • --base64: include base64-encoded PNG in JSON stdout under image_base64. Use only when the caller cannot access output files directly.
  • At least one of --output or --base64 must be provided.

> Recommended: Default to file output with --output.

> Do not use --base64 unless file delivery is impossible, because base64 image payloads consume a large number of tokens.

>

> ```bash

> python tools/openstreet_skill.py render \

> --points-file examples/points.json \

> --output output/annotated_map.png

> ```

Behavior:

  • Selects a suitable zoom level to fit all points.
  • Downloads OSM tiles and stitches them into one map image.
  • Draws numbered markers on each place.
  • Appends a three-column legend under the map showing index and place name.
  • Saves final image to --output path if specified.

JSON output structure:

{
  "zoom": 14,
  "size": { "width": 1200, "height": 880 },
  "places": [
    { "index": 1, "name": "Point A", "lat": 31.2304, "lon": 121.4737 }
  ],
  "output": "output/annotated_map.png"
}
  • output: present only when --output is provided.
  • image_base64: present only when --base64 is set. PNG image encoded as standard base64. Avoid this in normal flows because it significantly increases token usage.

Notes for OpenClaw integration

  • Expose these two CLI actions as callable tools in OpenClaw:
  • locate: maps to python tools/openstreet_skill.py locate ...
  • render: maps to python tools/openstreet_skill.py render ...
  • For render, default to --output file delivery instead of --base64 to keep responses small.
  • Return JSON stdout to the caller and treat non-zero exit code as failure.
  • Respect OSM usage policy by not sending high-frequency requests.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 08:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,055 📥 796,042
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,799
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,158