home / skills / openclaw / skills / gaodemapskill

gaodemapskill skill

/skills/279458179/gaodemapskill

This skill helps you search places and plan routes with Gaode Map API, simplifying location discovery and travel planning.

npx playbooks add skill openclaw/skills --skill gaodemapskill

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
1.6 KB
---
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.

### Place Search
Search for POIs (Points of Interest).

**Command:**
```bash
python amap_tool.py search --keywords "<keywords>" [--city "<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:**
```bash
python amap_tool.py route --origin "<origin>" --destination "<destination>" [--mode "<mode>"] [--city "<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:**
```bash
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:**
```bash
python amap_tool.py route --origin "Beijing West Station" --destination "Forbidden City" --mode "driving" --city "Beijing"
```

Overview

This skill provides a simple interface to interact with Gaode Map (AMap) for location search and route planning. It exposes command-line operations to find points of interest and to compute routes for driving, walking, bicycling, or public transit. The API key is read from the AMAP_API_KEY environment variable for secure, repeatable calls.

How this skill works

The tool sends requests to the AMap REST API to perform place (POI) searches and to request route planning between an origin and destination. For searches you provide keywords and an optional city to narrow results. For routing you provide origin and destination as addresses or coordinates, choose a mode (driving, walking, bicycling, transit), and optionally include a city to assist geocoding or transit queries.

When to use it

  • Find nearby businesses or amenities by keyword and city.
  • Generate driving, walking, bicycling, or transit routes between two locations.
  • Resolve addresses to coordinates for mapping or distance calculations.
  • Automate location lookups in scripts or integrate AMap into workflows.
  • Plan multi-mode trips where transit requires a specific city context.

Best practices

  • Set AMAP_API_KEY in the environment rather than embedding keys in code.
  • Include the city parameter for ambiguous place names or for transit route planning.
  • Pass coordinates (lon,lat) when available to avoid geocoding errors.
  • Validate API responses and handle rate limits or quota errors gracefully.
  • Cache frequent search results to reduce API calls and latency.

Example use cases

  • Search for coffee shops in Shanghai to display options to a user or populate a local directory.
  • Compute driving directions from an airport to a hotel for a travel itinerary.
  • Find nearby gas stations along a planned route for trip planning.
  • Obtain walking directions between two landmarks for a guided tour app.
  • Use transit mode with a city parameter to produce public transport routes and schedules.

FAQ

How do I supply the AMap API key?

Set the AMAP_API_KEY environment variable before running the commands so the tool can authenticate with the AMap API.

Can I use coordinates instead of addresses?

Yes. Provide origin and destination as 'lon,lat' to bypass geocoding and improve accuracy.