amap-traffic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese高德实时路况与路线规划
Amap Real-time Traffic and Route Planning
概述
Overview
本技能通过高德地图API实现:
- 实时路况查询:获取指定道路/区域的拥堵状态
- 智能路线规划:基于实时路况计算最快自驾路线
- 多方案对比:提供时间、距离、费用等维度的路线比较
This skill is implemented via Amap APIs, including:
- Real-time Traffic Query: Obtain congestion status of specified roads/areas
- Intelligent Route Planning: Calculate the fastest self-driving route based on real-time traffic
- Multi-scheme Comparison: Provide route comparisons in dimensions such as time, distance, cost, etc.
🔑 API Key 配置
🔑 API Key Configuration
- 访问 高德开放平台 创建 Key
- 在 OpenClaw Web 配置页面设置:
地址: http://127.0.0.1:18789/skills
配置文件字段:inskills.entries.amap-traffic.AMAP_KEYopenclaw.json
值: 你的高德API Key
注意: 本技能每次调用时都会重新读取中的最新openclaw.json,支持前端动态更新密钥后立即生效。AMAP_KEY
- Visit Amap Open Platform to create a Key
- Set it on the OpenClaw Web configuration page:
Address: http://127.0.0.1:18789/skills
Configuration file field:inskills.entries.amap-traffic.AMAP_KEYopenclaw.json
Value: Your Amap API Key
Note: This skill reads the latestfromAMAP_KEYevery time it is called, supporting immediate effect after dynamic key update on the frontend.openclaw.json
API 使用说明
API Usage Instructions
1. 实时路况查询
1. Real-time Traffic Query
bash
curl "https://restapi.amap.com/v3/traffic/status/road?roadid={道路ID}&key={动态读取的AMAP_KEY}"bash
curl "https://restapi.amap.com/v3/traffic/status/road?roadid={Road ID}&key={Dynamically read AMAP_KEY}"2. 智能路线规划(含实时路况)
2. Intelligent Route Planning (with real-time traffic)
bash
curl "https://restapi.amap.com/v3/direction/driving?origin={起点坐标}&destination={终点坐标}&strategy=2&key={动态读取的AMAP_KEY}"- :优先考虑实时路况的最快路线
strategy=2
bash
curl "https://restapi.amap.com/v3/direction/driving?origin={Starting coordinates}&destination={Destination coordinates}&strategy=2&key={Dynamically read AMAP_KEY}"- : Prioritize the fastest route considering real-time traffic
strategy=2
路况状态说明
Traffic Status Explanation
- 畅通:🟢 绿色(速度 > 40km/h)
- 缓行:🟡 黄色(20-40km/h)
- 拥堵:🔴 红色(< 20km/h)
- 严重拥堵:🟣 紫红色(< 10km/h)
- Smooth: 🟢 Green (Speed > 40km/h)
- Slow-moving: 🟡 Yellow (20-40km/h)
- Congested: 🔴 Red (< 20km/h)
- Severely Congested: 🟣 Magenta (< 10km/h)
资源
Resources
scripts/
scripts/
包含高德实时路况查询和路线规划的核心脚本。
Contains core scripts for Amap real-time traffic query and route planning.
scripts/amap_traffic.py
scripts/amap_traffic.py
Python 脚本,实现完整的实时路况查询和最优路线规划功能。
每次执行时都会从 读取最新的 AMAP_KEY,
确保前端动态更新密钥后立即生效。
/home/admin/.openclaw/openclaw.jsonPython script that implements complete real-time traffic query and optimal route planning functions.
It reads the latest AMAP_KEY from every time it executes, ensuring immediate effect after dynamic key update on the frontend.
/home/admin/.openclaw/openclaw.json