高德地图:地点搜索与路径规划 - Openclaw Skills

作者:互联网

2026-03-25

AI教程

什么是 高德地图集成?

高德地图技能为 AI 智能体提供了与高德 API 交互的强大接口,实现了位置感知功能。通过在 Openclaw Skills 框架中使用此技能,开发者可以让智能体在中国境内高精度地查找特定兴趣点 (POI) 并计算复杂的路径。它是原始地理数据与可执行智能体响应之间的桥梁。

该技能对于构建旅游助手或本地探索工具的开发者特别有用。它通过提供简化的基于 CLI 的交互模型,简化了地理编码和路径规划的复杂性,自然地融入任何 Openclaw Skills 实现中。

下载入口:https://github.com/openclaw/skills/tree/main/skills/279458179/gaodemapskill

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install gaodemapskill

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 gaodemapskill。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

高德地图集成 应用场景

  • 在特定城市内寻找特定的商业机构或服务,如咖啡馆、加油站或餐厅。
  • 使用包括驾车和公共交通在内的各种交通方式规划两个地点之间的旅行路线。
  • 将地理数据集成到需要精确地点搜索和导航的自动化工作流中。
  • 通过实时地图和路径规划数据增强与旅行相关的 AI 助手。
高德地图集成 工作原理
  1. 该技能使用专用 Python 脚本和通过环境变量提供的有效 API 密钥与高德地图 API 进行交互。
  2. 用户或智能体通过命令行参数提供搜索关键词或路径规划的起点/终点。
  3. 工具自动处理地理编码,将地址字符串转换为高德后端所需的坐标。
  4. 它返回结构化的位置或路径数据,然后由 Openclaw Skills 生态系统中的调用智能体进行解析和呈现。

高德地图集成 配置指南

要开始使用此技能,您必须安装 Python 并从高德开放平台获取 API Key。按如下方式配置您的环境:

# 设置您的 AMap API Key
export AMAP_API_KEY='your_api_key_here'

# 运行测试搜索
python amap_tool.py search --keywords "coffee shop" --city "Shanghai"

高德地图集成 数据架构与分类体系

该技能基于灵活的模式处理位置数据和路线信息。以下是交互期间使用的主要字段:

参数 类型 描述
keywords 字符串 兴趣点 (POI) 的搜索查询。
origin 字符串 起始位置,接受地址或 "经度,纬度" 坐标。
destination 字符串 结束位置,接受地址或 "经度,纬度" 坐标。
mode 字符串 交通方式:驾车、步行、骑行或公交。
city 字符串 可选城市名称,用于优化搜索结果或地理编码精度。
name: gaode_map
description: A skill to interact with Gaode Map (AMap) for location search and route planning.
metadata:
  openclaw:
    requires:
      env: ["AMAP_API_KEY"]
      bins: ["python"]

Gaode Map Skill

This skill allows you to search for places and plan routes using Gaode Map (AMap) API.

Usage

You can use the amap_tool.py script to perform actions. The API Key is expected to be in the AMAP_API_KEY environment variable.

Search for POIs (Points of Interest).

Command:

python amap_tool.py search --keywords "" [--city ""]

Parameters:

  • keywords: The search query (e.g., "restaurants", "gas station").
  • city: (Optional) The city to search in.

Route Planning

Plan a route between two locations.

Command:

python amap_tool.py route --origin "" --destination "" [--mode ""] [--city ""]

Parameters:

  • origin: Start location (address or coordinates "lon,lat").
  • destination: End location (address or coordinates "lon,lat").
  • mode: (Optional) Route mode: driving (default), walking, bicycling, transit.
  • city: (Optional) City name (required for transit mode, or to help geocoding).

Examples

User: "Find coffee shops in Shanghai." Action:

python amap_tool.py search --keywords "coffee shop" --city "Shanghai"

User: "Show me the driving route from Beijing West Station to the Forbidden City." Action:

python amap_tool.py route --origin "Beijing West Station" --destination "Forbidden City" --mode "driving" --city "Beijing"