路线地图可视化
route-map-visualizer
使用此技能在地图上可视化路线和位置——尤其是在上游工具调用(路由连接器、Azure Maps、Bing Maps 连接器、HERE、Mapbox、Dataverse、CRM、SharePoint 或任何返回坐标的连接器)返回了有序站点、坐标、距离或道路几何之后。可生成 PNG、交互式 HTML、GeoJSON、KML、深链接和二维码。也用于标记地图(天气、CRM 数据、站点列表),以及任何“在地图上显示这些位置”“绘制这些位置”“可视化这条路线”的请求。请勿使用此技能计算路由——请先调用路由连接器,再将结果传至此进行可视化。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 107
- Forks
- 120
01 前言 Front Matter
- name
- route-map-visualizer
- description
- Use this skill to visualize routes and locations on a map — especially after an upstream tool call (routing connector, Azure Maps, Bing Maps connector, HERE, Mapbox, Dataverse, CRM, SharePoint, or any connector that returns coordinates) has returned ordered stops, coordinates, distances, or road geometry. Produces PNG, interactive HTML, GeoJSON, KML, deep links, and QR codes. Also use for marker maps (weather, CRM data, site lists) and for any request to "show these on a map", "map these locations", or "visualize this route". DO NOT use this skill to compute routing — call a routing connector first, then pass the result here for visualization.
02 资源文件 8
- 资产文件assets/place_lookup.json4.0 KB
- 资产文件assets/sample_stops_coords.json519 B
- 资产文件assets/sample_weather_map.json732 B
- 资产文件assets/sample_with_geometry.json1.9 KB
- 参考文档metadata.json844 B
- 参考文档README.md6.5 KB
- 参考文档references/cheatsheet.md5.0 KB
- 脚本scripts/map_generator.py92.4 KB
03 SKILL.md 正文
Visualizes pre-ordered routes and location maps via scripts/map_generator.py.
Fully offline Python engine — no outbound HTTP from Python. Road geometry
rendered directly when provided by a connector; OSRM used browser-side as a
fallback when it is not.
Steps
1. Choose kind
| Value | Use when |
|---|---|
"map" |
Plot locations only — no path (weather, CRM records, site lists) |
"route" |
Ordered stops + path |
"auto" |
Default — infers map unless stops key or round_trip hint |
2. Resolve coordinates — per point, in order:
lat/lonalready present — from user, connector result, Dataverse, CRM, CSV, etc. Never overwrite.- Alias match in
assets/place_lookup.json - Web-search the place's lat/lon, then add to payload
Never call external geocoding APIs from the script. Never invent coordinates.
3. Pass connector route data (when available)
If an upstream connector (Azure Maps, Bing Maps, etc.) returned routing data, pass it directly — the visualizer will use it for accurate distances and the actual road polyline in PNG and HTML:
| Field | Source | Effect |
|---|---|---|
route_geometry |
Connector road polyline | Draw actual road path in PNG + HTML |
legs |
Connector leg breakdown | Show per-leg distance/time table |
route_source |
e.g. "azure_maps" |
Attribution badge on map and outputs |
total_distance_m |
Connector total distance | Accurate distance in header + exports |
total_duration_s |
Connector total time | Accurate time in header + exports |
Without these, the PNG uses straight lines (labeled schematic) and the HTML calls OSRM browser-side for road routing.
4. Point fields
| Field | Notes |
|---|---|
lat, lon |
Required (or place_lookup match) |
name |
Display label |
value |
Metric — "24 C", "$1.2M", CRM field, etc. |
icon |
See icon list below |
color |
Hex (validated — invalid values fall back to default) |
order |
Optional sequence number (connector-assigned) |
5. Call generate()
import sys; sys.path.insert(0, "scripts")
from map_generator import generate
# Minimal — stops in provided order, schematic PNG, OSRM HTML
result = generate({
"kind": "route",
"title": "Delivery run",
"stops": [
{"name": "Depot", "lat": -33.86, "lon": 151.21},
{"name": "Stop A", "lat": -33.90, "lon": 151.18},
{"name": "Stop B", "lat": -33.88, "lon": 151.15},
],
# Optional exports (all off by default):
# "html": True "csv": True "geojson": True "kml": True
# "map_links": True "qr_codes": True
})
# With connector road data — produces accurate PNG + no OSRM needed
result = generate({
"kind": "route",
"title": "Delivery run — Azure Maps",
"stops": [...],
"route_geometry": [ # connector road polyline
{"lat": -33.860, "lon": 151.210},
{"lat": -33.865, "lon": 151.208},
...
],
"legs": [ # per-leg breakdown
{"from": "Depot", "to": "Stop A", "distance_m": 5200,
"duration_s": 420, "summary": "via Parramatta Rd"},
{"from": "Stop A", "to": "Stop B", "distance_m": 3100,
"duration_s": 280, "summary": "via Church St"},
],
"route_source": "azure_maps",
"total_distance_m": 8300,
"total_duration_s": 700,
"html": True,
})
print(result["markdown"])
Key result keys: chart_path (PNG, always), html_path, csv_path,
geojson_path, kml_path, map_links_path, qr_sheet_path,
google_maps_url, apple_maps_url, bing_maps_url, has_road_geometry,
route_source, generated_exports.
6. Reply — paste result["markdown"]. It always ends with an Optional
exports hint. Clarify:
- PNG = road route when
route_geometryprovided, else straight-line schematic - HTML = connector polyline embedded (no OSRM) when geometry provided, else OSRM browser-side
schematic_order: true— opt-in offline stop ordering (NN + 2-opt, straight-line estimate); always prefer a connector for real road order
Icons
pin sunny partly-cloudy cloudy rain storm snow fog wind
hot cold office home factory hospital school warning check
star shop truck
Guardrails
- Never overwrite
lat/lonfrom user or prior tools. - Never call external geocoding/routing APIs from the Python script.
- Never invent coordinates — ask the user or web-search.
- Never reorder stops unless
"schematic_order": trueis explicitly set.
Bundled files
scripts/map_generator.py— engine (generate)assets/place_lookup.json— place aliasesreferences/cheatsheet.md— full payload reference + CLI flags
04 同仓库更多 Skills
work-iq-sphere
Build or refresh a personal "My Work IQ" visual from the signed-in user's own Microsoft 365 work (mail, calendar, Teams chats and the OneDrive and SharePoint files they worked on, with Week, Month and 3 months views from one read of their data, about all their work or one customer, programme or topic they name) as an interactive 3D sphere (self-contained HTML), a customer-safe copy and a matching Microsoft-style PowerPoint slide. Every build is a fresh, evidence-checked analysis of that one person's own data. Use when someone says "build my Work IQ sphere", "show my Work IQ", "refresh" or "update my Work IQ", "make my Work IQ slide", "visualise my work graph", "show me the Work IQ sphere demo", or wants to show customers what Work IQ (context, memory, skills) means using their own work. Do NOT use for generic decks, Work IQ product or licensing questions with no personal data, or anyone else's, team or org-wide analytics.
severity-recordability
Runs the deterministic local v2 draft classifier; reporting/deadlines remain undetermined. Use for "explain blocked reporting determination", "is this recordable", "classify this incident", "what severity is this", or "is this OSHA reportable". Do NOT use for source intake, history retrieval or routing — use incident-intake, ehs-knowledge-retrieve or routing-notify. No diagnosis or operational decision; EHS REVIEW REQUIRED.
routing-notify
Computes proposed investigators and unsent recipients from validated local classification, history and governance. Use for "propose unsent incident recipients", "who investigates this", "route this incident", "who do we notify", or "start the OSHA clock" (only to explain the blocked clock). Do NOT use for classification or terminal drafting — use severity-recordability or incident-writeup. Never sends, files or starts a clock; EHS REVIEW REQUIRED.
incident-writeup
Revalidates and recomputes every terminal v2 hop, then renders a null-aware local Markdown draft and blank RCA template. Use for "prepare an evidence-grounded incident draft", "draft the incident summary", "write up the incident", "give me the RCA template", or "prepare the OSHA writeup". Do NOT use for intake, classification or routing — use incident-intake, severity-recordability or routing-notify. No operational actions; EHS REVIEW REQUIRED.
incident-intake
Preserves cited authorized user-supplied incident files, including real incidents, as v2 inputs for human-reviewed drafts only. Use for "preserve conflicting incident accounts", "intake this incident", "process this safety report", "extract incident facts", or "intake this near miss". Do NOT use for classification, routing or terminal drafting — use severity-recordability, routing-notify or incident-writeup respectively. No live retrieval or official determinations; EHS REVIEW REQUIRED.
ehs-knowledge-retrieve
Attaches cited local OSHA, ISO summaries, JHA and policies and computes supplied-log history. Use for "find cited local safety evidence", "pull the OSHA criteria", "get the JHA", "attach local EHS evidence", or "have we had this incident before". Do NOT use for incident intake, recordability decisions or drafting — use incident-intake, severity-recordability or incident-writeup. No live retrieval; EHS REVIEW REQUIRED.