mapbox-geospatial-operations
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMapbox Geospatial Operations Skill
Mapbox 地理空间操作技能
Expert guidance for AI assistants on choosing the right geospatial tools from the Mapbox MCP Server. Focuses on selecting tools based on what the problem requires - geometric calculations vs routing, straight-line vs road network, and accuracy needs.
为AI助手提供专业指导,帮助从Mapbox MCP Server中选择合适的地理空间工具。重点根据问题实际需求来选择工具——是几何计算还是路径规划,是直线距离还是道路网络,以及精度要求。
Core Principle: Problem Type Determines Tool Choice
核心原则:问题类型决定工具选择
The Mapbox MCP Server provides two categories of geospatial tools:
- Offline Geometric Tools - Use Turf.js for pure geometric/spatial calculations
- Routing & Navigation APIs - Use Mapbox APIs when you need real-world routing, traffic, or travel times
The key question: What does the problem actually require?
Mapbox MCP Server提供两类地理空间工具:
- 离线几何工具 - 使用Turf.js进行纯几何/空间计算
- 路径规划与导航API - 当需要实际道路路径、交通状况或行程时间时,使用Mapbox API
关键问题:问题实际需要什么?
Decision Framework
决策框架
| Problem Characteristic | Tool Category | Why |
|---|---|---|
| Straight-line distance (as the crow flies) | Offline geometric | Accurate for geometric distance |
| Road/path distance (as the crow drives) | Routing API | Only routing APIs know road networks |
| Travel time | Routing API | Requires routing with speed/traffic data |
| Point containment (is X inside Y?) | Offline geometric | Pure geometric operation |
| Geographic shapes (buffers, centroids, areas) | Offline geometric | Mathematical/geometric operations |
| Traffic-aware routing | Routing API | Requires real-time traffic data |
| Route optimization (best order to visit) | Routing API | Complex routing algorithm |
| High-frequency checks (e.g., real-time geofencing) | Offline geometric | Instant response, no latency |
| 问题特征 | 工具类别 | 原因 |
|---|---|---|
| 直线距离(直线飞行距离) | 离线几何工具 | 几何距离计算准确 |
| 道路/路径距离(实际驾驶距离) | 路径规划API | 只有路径规划API了解道路网络 |
| 行程时间 | 路径规划API | 需要结合速度/交通数据的路径规划 |
| 点包含判断(X是否在Y内部?) | 离线几何工具 | 纯几何操作 |
| 地理形状(缓冲区、质心、面积) | 离线几何工具 | 数学/几何运算 |
| 交通感知路径规划 | 路径规划API | 需要实时交通数据 |
| 路径优化(最优访问顺序) | 路径规划API | 复杂路径规划算法 |
| 高频检查(如实时地理围栏) | 离线几何工具 | 即时响应,无延迟 |
Decision Matrices by Use Case
按用例划分的决策矩阵
Distance Calculations
距离计算
User asks: "How far is X from Y?"
| What They Actually Mean | Tool Choice | Why |
|---|---|---|
| Straight-line distance (as the crow flies) | | Accurate for geometric distance, instant |
| Driving distance (as the crow drives) | | Only routing knows actual road distance |
| Walking/cycling distance (as the crow walks/bikes) | | Need specific path network |
| Travel time | | Requires routing with speed data |
| Distance with current traffic | | Need real-time traffic consideration |
Example: "What's the distance between these 5 warehouses?"
- As the crow flies → (10 calculations, instant)
distance_tool - As the crow drives → (5×5 matrix, one API call, returns actual route distances)
matrix_tool
Key insight: Use the tool that matches what "distance" means in context. Always clarify: crow flies or crow drives?
用户提问:"X到Y有多远?"
| 用户实际需求 | 工具选择 | 原因 |
|---|---|---|
| 直线距离(直线飞行距离) | | 几何距离计算准确,即时返回 |
| 驾驶距离(实际驾驶路线距离) | | 只有路径规划工具能获取实际道路距离 |
| 步行/骑行距离(实际步行/骑行路线距离) | | 需要特定的路径网络数据 |
| 行程时间 | | 需要结合速度数据的路径规划 |
| 考虑当前交通状况的距离 | | 需要纳入实时交通状况考量 |
示例:"这5个仓库之间的距离是多少?"
- 直线飞行距离 → (10次计算,即时完成)
distance_tool - 实际驾驶距离 → (5×5矩阵,一次API调用,返回实际路线距离)
matrix_tool
关键见解:选择与上下文"距离"含义匹配的工具。务必明确:是直线飞行距离还是实际驾驶距离?
Proximity and Containment
邻近性与包含判断
User asks: "Which points are near/inside this area?"
| Query Type | Tool Choice | Why |
|---|---|---|
| "Within X meters radius" | | Simple geometric radius |
| "Within X minutes drive" | | Need routing for travel-time zone, then geometric containment |
| "Inside this polygon" | | Pure geometric containment test |
| "Reachable by car in 30 min" | | Requires routing + traffic |
| "Nearest to this point" | | Depends on definition of "nearest" |
Example: "Are these 200 addresses in our 30-minute delivery zone?"
- Create zone → (routing API - need travel time)
isochrone_tool - Check addresses → (geometric - 200 instant checks)
point_in_polygon_tool
Key insight: Routing for creating travel-time zones, geometric for containment checks
用户提问:"哪些点在这个区域附近/内部?"
| 查询类型 | 工具选择 | 原因 |
|---|---|---|
| "在X米半径范围内" | | 简单的几何半径计算 |
| "在X分钟驾驶范围内" | | 需要路径规划生成行程时间区域,再进行几何包含判断 |
| "在这个多边形内部" | | 纯几何包含性检验 |
| "30分钟车程可达范围" | | 需要结合路径规划与交通数据 |
| "离该点最近的点" | | 取决于"最近"的定义 |
示例:"这200个地址中哪些在我们30分钟配送范围内?"
- 生成配送区域 → (路径规划API - 需要行程时间数据)
isochrone_tool - 检查地址 → (200次几何检查即时完成)
point_in_polygon_tool
关键见解:使用路径规划工具生成行程时间区域,使用几何工具进行快速包含判断
Routing and Navigation
路径规划与导航
User asks: "What's the best route?"
| Scenario | Tool Choice | Why |
|---|---|---|
| A to B directions | | Turn-by-turn routing |
| Optimal order for multiple stops | | Solves traveling salesman problem |
| Clean GPS trace | | Snaps to road network |
| Just need bearing/compass direction | | Simple geometric calculation |
| Route with traffic | | Real-time traffic awareness |
| Fixed-order waypoints | | Routing through specific points |
Example: "Navigate from hotel to airport"
- Need turn-by-turn →
directions_tool - Just need to know "it's northeast" →
bearing_tool
Key insight: Routing tools for actual navigation, geometric tools for directional info
用户提问:"最佳路线是什么?"
| 场景 | 工具选择 | 原因 |
|---|---|---|
| A到B的路线导航 | | 逐向导航功能 |
| 多站点最优访问顺序 | | 解决旅行商问题 |
| 清理GPS轨迹 | | 将轨迹匹配到道路网络上 |
| 仅需要方位/罗盘方向 | | 简单的几何计算 |
| 考虑交通状况的路线 | | 实时交通感知 |
| 固定顺序的途经点路线 | | 途经指定点的路径规划 |
示例:"从酒店导航到机场"
- 需要逐向导航 →
directions_tool - 仅需要知道"在东北方向" →
bearing_tool
关键见解:路径规划工具用于实际导航,几何工具用于方位信息获取
Area and Shape Operations
区域与形状操作
User asks: "Create a zone around this location"
| Requirement | Tool Choice | Why |
|---|---|---|
| Simple circular buffer | | Geometric circle/radius |
| Travel-time zone | | Based on routing network |
| Calculate area size | | Geometric calculation |
| Simplify complex boundary | | Geometric simplification |
| Find center of shape | | Geometric centroid |
Example: "Show 5km coverage around each store"
- 5km radius → (geometric circles)
buffer_tool - "What customers can reach in 15 min?" → (routing-based)
isochrone_tool
Key insight: Geometric tools for distance-based zones, routing tools for time-based zones
用户提问:"在该位置周围生成一个区域"
| 需求 | 工具选择 | 原因 |
|---|---|---|
| 简单圆形缓冲区 | | 几何圆形/半径计算 |
| 行程时间区域 | | 基于路径规划网络生成 |
| 计算区域面积 | | 几何计算 |
| 简化复杂边界 | | 几何简化操作 |
| 查找形状中心 | | 几何质心计算 |
示例:"展示每家门店周边5公里覆盖范围"
- 5公里半径 → (几何圆形)
buffer_tool - "哪些客户能在15分钟内到达?" → (基于路径规划)
isochrone_tool
关键见解:几何工具用于基于距离的区域,路径规划工具用于基于时间的区域
Performance and Scale Considerations
性能与规模考量
When Volume Affects Tool Choice
数据量对工具选择的影响
Small operations (< 100 calculations):
- Geometric tools: Instant, iterate freely
- Routing APIs: Fast enough for most uses
Medium operations (100-1,000 calculations):
- Geometric tools: Still fast, no concerns
- Routing APIs: Consider batch operations (matrix_tool)
Large operations (> 1,000 calculations):
- Geometric tools: May need optimization but still fast
- Routing APIs: Definitely use batch tools (matrix_tool handles up to 25×25)
Key insight: Volume rarely affects geometric tool choice, but routing APIs have batch tools for efficiency
小规模操作(<100次计算):
- 几何工具:即时完成,可自由迭代
- 路径规划API:对大多数场景来说速度足够
中等规模操作(100-1000次计算):
- 几何工具:依然快速,无需担忧
- 路径规划API:考虑批量操作(matrix_tool)
大规模操作(>1000次计算):
- 几何工具:可能需要优化,但仍保持快速
- 路径规划API:务必使用批量工具(matrix_tool支持最多25×25矩阵)
关键见解:数据量几乎不影响几何工具的选择,但路径规划API有批量工具提升效率
Real-Time vs Batch
实时处理 vs 批量处理
| Use Case | Approach | Tool Choice |
|---|---|---|
| Real-time geofencing (every second) | Geometric checks | |
| Route planning (one-time) | Full routing | |
| Periodic proximity checks | Geometric distance | |
| Live traffic routing | Routing with traffic | |
| 用例 | 处理方式 | 工具选择 |
|---|---|---|
| 实时地理围栏(每秒检查一次) | 几何检查 | |
| 一次性路线规划 | 完整路径规划 | |
| 周期性邻近性检查 | 几何距离计算 | |
| 实时交通路线规划 | 带交通的路径规划 | |
Common Scenarios and Optimal Approaches
常见场景与最优方案
Scenario 1: Store Locator
场景1:门店定位器
User: "Find the closest store and show 5km coverage"
Optimal approach:
- Search stores → (returns distances automatically)
category_search_tool - Create coverage zone → (5km geometric circle)
buffer_tool - Visualize →
static_map_image_tool
Why: Search already gives distances; geometric buffer for simple radius
用户:"找到最近的门店并展示5公里覆盖范围"
最优方案:
- 搜索门店 → (自动返回距离)
category_search_tool - 生成覆盖区域 → (5公里几何圆形)
buffer_tool - 可视化 →
static_map_image_tool
原因:搜索工具已返回距离;几何缓冲区适合简单半径区域
Scenario 2: Delivery Route Optimization
场景2:配送路线优化
User: "Optimize delivery to 8 addresses"
Optimal approach:
- Geocode addresses →
search_and_geocode_tool - Optimize route → (TSP solver with routing)
optimization_tool
Why: Need actual routing for turn-by-turn delivery, not geometric distances
用户:"优化8个地址的配送路线"
最优方案:
- 地址地理编码 →
search_and_geocode_tool - 路线优化 → (带路径规划的TSP求解器)
optimization_tool
原因:需要实际导航路线用于配送,而非几何距离
Scenario 3: Service Area Validation
场景3:服务区域验证
User: "Which of these 200 addresses can we deliver to in 30 minutes?"
Optimal approach:
- Create delivery zone → (30-minute driving)
isochrone_tool - Check each address → (200 geometric checks)
point_in_polygon_tool
Why: Routing for accurate travel-time zone, geometric for fast containment checks
用户:"这200个地址中哪些能在30分钟内送达?"
最优方案:
- 生成配送区域 → (30分钟驾驶范围)
isochrone_tool - 检查每个地址 → (200次几何检查)
point_in_polygon_tool
原因:路径规划工具生成准确的行程时间区域,几何工具快速完成包含判断
Scenario 4: GPS Trace Analysis
场景4:GPS轨迹分析
User: "How long was this bike ride?"
Optimal approach:
- Clean GPS trace → (snap to bike paths)
map_matching_tool - Get distance → Use API response or calculate with
distance_tool
Why: Need road/path matching; distance calculation either way works
用户:"这次骑行有多长?"
最优方案:
- 清理GPS轨迹 → (匹配到自行车道)
map_matching_tool - 获取距离 → 使用API响应或计算
distance_tool
原因:需要路径匹配;两种方式均可计算距离
Scenario 5: Coverage Analysis
场景5:覆盖范围分析
User: "What's our total service area?"
Optimal approach:
- Create buffers around each location →
buffer_tool - Calculate total area →
area_tool - Or, if time-based → for each location
isochrone_tool
Why: Geometric for distance-based coverage, routing for time-based
用户:"我们的总服务区域是多少?"
最优方案:
- 在每个位置周围生成缓冲区 →
buffer_tool - 计算总面积 →
area_tool - 若为基于时间的范围 → 为每个位置使用
isochrone_tool
原因:几何工具用于基于距离的覆盖范围,路径规划工具用于基于时间的
Anti-Patterns: Using the Wrong Tool Type
反模式:使用错误的工具类型
❌ Don't: Use geometric tools for routing questions
❌ 错误做法:用几何工具处理路径规划问题
javascript
// WRONG: User asks "how long to drive there?"
distance_tool({ from: A, to: B });
// Returns 10km as the crow flies, but actual drive is 15km
// CORRECT: Need routing for driving distance
directions_tool({
coordinates: [
{ longitude: A[0], latitude: A[1] },
{ longitude: B[0], latitude: B[1] }
],
routing_profile: 'mapbox/driving'
});
// Returns actual road distance and drive time as the crow drivesWhy wrong: As the crow flies ≠ as the crow drives
javascript
// WRONG: User asks "how long to drive there?"
distance_tool({ from: A, to: B });
// Returns 10km as the crow flies, but actual drive is 15km
// CORRECT: Need routing for driving distance
directions_tool({
coordinates: [
{ longitude: A[0], latitude: A[1] },
{ longitude: B[0], latitude: B[1] }
],
routing_profile: 'mapbox/driving'
});
// Returns actual road distance and drive time as the crow drives错误原因:直线飞行距离 ≠ 实际驾驶距离
❌ Don't: Use routing APIs for geometric operations
❌ 错误做法:用路径规划API处理几何操作
javascript
// WRONG: Check if point is in polygon
// (Can't do this with routing APIs)
// CORRECT: Pure geometric operation
point_in_polygon_tool({ point: location, polygon: boundary });Why wrong: Routing APIs don't do geometric containment
javascript
// WRONG: Check if point is in polygon
// (Can't do this with routing APIs)
// CORRECT: Pure geometric operation
point_in_polygon_tool({ point: location, polygon: boundary });错误原因:路径规划API不支持几何包含判断
❌ Don't: Confuse "near" with "reachable"
❌ 错误做法:混淆"邻近"与"可达"
javascript
// User asks: "What's reachable in 20 minutes?"
// WRONG: 20-minute distance at average speed
distance_tool + calculate 20min * avg_speed
// CORRECT: Actual routing with road network
isochrone_tool({
coordinates: {longitude: startLng, latitude: startLat},
contours_minutes: [20],
profile: "mapbox/driving"
})Why wrong: Roads aren't straight lines; traffic varies
javascript
// User asks: "What's reachable in 20 minutes?"
// WRONG: 20-minute distance at average speed
distance_tool + calculate 20min * avg_speed
// CORRECT: Actual routing with road network
isochrone_tool({
coordinates: {longitude: startLng, latitude: startLat},
contours_minutes: [20],
profile: "mapbox/driving"
})错误原因:道路并非直线;交通状况多变
❌ Don't: Use routing when bearing is sufficient
❌ 错误做法:用路径规划工具仅获取方位信息
javascript
// User asks: "Which direction is the airport?"
// OVERCOMPLICATED: Full routing
directions_tool({
coordinates: [
{ longitude: hotel[0], latitude: hotel[1] },
{ longitude: airport[0], latitude: airport[1] }
]
});
// BETTER: Just need bearing
bearing_tool({ from: hotel, to: airport });
// Returns: "Northeast (45°)"Why better: Simpler, instant, answers the actual question
javascript
// User asks: "Which direction is the airport?"
// OVERCOMPLICATED: Full routing
directions_tool({
coordinates: [
{ longitude: hotel[0], latitude: hotel[1] },
{ longitude: airport[0], latitude: airport[1] }
]
});
// BETTER: Just need bearing
bearing_tool({ from: hotel, to: airport });
// Returns: "Northeast (45°)"更优原因:更简单、即时,直接回答用户实际问题
Hybrid Approaches: Combining Tool Types
混合方案:结合两类工具
Some problems benefit from using both geometric and routing tools:
部分问题同时使用几何工具和路径规划工具效果更佳:
Pattern 1: Routing + Geometric Filter
模式1:路径规划 + 几何过滤
1. directions_tool → Get route geometry
2. buffer_tool → Create corridor around route
3. category_search_tool → Find POIs in corridor
4. point_in_polygon_tool → Filter to those actually along routeUse case: "Find gas stations along my route"
1. directions_tool → 获取路线几何数据
2. buffer_tool → 在路线周围生成走廊区域
3. category_search_tool → 查找走廊内的POI
4. point_in_polygon_tool → 过滤出实际沿路线的POI用例:"找到我路线上的加油站"
Pattern 2: Routing + Distance Calculation
模式2:路径规划 + 距离计算
1. category_search_tool → Find 10 nearby locations
2. distance_tool → Calculate straight-line distances (geometric)
3. For top 3, use directions_tool → Get actual driving timeUse case: Quickly narrow down, then get precise routing for finalists
1. category_search_tool → 找到10个附近地点
2. distance_tool → 计算直线距离(几何)
3. 对排名前三的地点,使用directions_tool → 获取实际驾驶时间用例:快速缩小范围,再为最终候选获取精确路径规划
Pattern 3: Isochrone + Containment
模式3:等时线 + 包含判断
1. isochrone_tool → Create travel-time zone (routing)
2. point_in_polygon_tool → Check hundreds of addresses (geometric)Use case: "Which customers are in our delivery zone?"
1. isochrone_tool → 生成行程时间区域(路径规划)
2. point_in_polygon_tool → 检查数百个地址(几何)用例:"哪些客户在我们的配送范围内?"
Decision Algorithm
决策算法
When user asks a geospatial question:
1. Does it require routing, roads, or travel times?
YES → Use routing API (directions, matrix, isochrone, optimization)
NO → Continue
2. Does it require traffic awareness?
YES → Use directions_tool or isochrone_tool with traffic profile
NO → Continue
3. Is it a geometric/spatial operation?
- Distance between points (straight-line) → distance_tool
- Point containment → point_in_polygon_tool
- Area calculation → area_tool
- Buffer/zone → buffer_tool
- Direction/bearing → bearing_tool
- Geometric center → centroid_tool
- Bounding box → bounding_box_tool
- Simplification → simplify_tool
4. Is it a search/discovery operation?
YES → Use search tools (search_and_geocode, category_search)当用户提出地理空间问题时:
1. 是否需要路径规划、道路或行程时间?
是 → 使用路径规划API(directions、matrix、isochrone、optimization)
否 → 继续
2. 是否需要感知交通状况?
是 → 使用directions_tool或isochrone_tool并选择交通配置文件
否 → 继续
3. 是否为几何/空间操作?
- 点间距离(直线)→ distance_tool
- 点包含判断 → point_in_polygon_tool
- 面积计算 → area_tool
- 缓冲区/区域 → buffer_tool
- 方向/方位 → bearing_tool
- 几何中心 → centroid_tool
- 边界框 → bounding_box_tool
- 简化 → simplify_tool
4. 是否为搜索/发现操作?
是 → 使用搜索工具(search_and_geocode、category_search)Key Decision Questions
关键决策问题
Before choosing a tool, ask:
-
Does "distance" mean as the crow flies or as the crow drives?
- As the crow flies (straight-line) → geometric tools
- As the crow drives (road distance) → routing APIs
-
Does the user need travel time?
- Yes → routing APIs (only they know speeds/traffic)
- No → geometric tools may suffice
-
Is this about roads/paths or pure spatial relationships?
- Roads/paths → routing APIs
- Spatial relationships → geometric tools
-
Does this need to happen in real-time with low latency?
- Yes + geometric problem → offline tools (instant)
- Yes + routing problem → use routing APIs (still fast)
-
Is accuracy critical, or is approximation OK?
- Critical + routing → routing APIs
- Approximation OK → geometric tools may work
选择工具前,需明确:
-
"距离"指的是直线飞行距离还是实际驾驶距离?
- 直线飞行距离 → 几何工具
- 实际驾驶距离 → 路径规划API
-
用户是否需要行程时间?
- 是 → 路径规划API(只有它们能获取速度/交通数据)
- 否 → 几何工具可能足够
-
问题是关于道路/路径还是纯空间关系?
- 道路/路径 → 路径规划API
- 空间关系 → 几何工具
-
是否需要实时低延迟处理?
- 是 + 几何问题 → 离线工具(即时)
- 是 + 路径规划问题 → 使用路径规划API(仍快速)
-
精度是否关键,还是近似值即可?
- 关键 + 路径规划 → 路径规划API
- 近似值即可 → 几何工具可能适用
Terminology Guide
术语指南
Understanding what users mean:
| User Says | Usually Means | Tool Type |
|---|---|---|
| "Distance" | Context-dependent! Ask: crow flies or crow drives? | Varies |
| "How far" | Often as the crow drives (road distance) | Routing API |
| "Nearby" | Usually as the crow flies (straight-line radius) | Geometric |
| "Close" | Could be either - clarify! | Ask |
| "Reachable" | Travel-time based (crow drives with traffic) | Routing API |
| "Inside/contains" | Geometric containment | Geometric |
| "Navigate/directions" | Turn-by-turn routing | Routing API |
| "Bearing/direction" | Compass direction (crow flies) | Geometric |
理解用户表述的含义:
| 用户表述 | 通常含义 | 工具类型 |
|---|---|---|
| "距离" | 取决于上下文!需明确:是直线飞行还是实际驾驶? | 不确定 |
| "有多远" | 通常指实际驾驶距离 | 路径规划API |
| "附近" | 通常指直线飞行距离(半径范围) | 几何工具 |
| "近" | 可能是两者之一,需确认! | 需询问用户 |
| "可达" | 基于行程时间(考虑交通的实际驾驶) | 路径规划API |
| "在内部/包含" | 几何包含关系 | 几何工具 |
| "导航/路线" | 逐向导航 | 路径规划API |
| "方位/方向" | 罗盘方向(直线飞行) | 几何工具 |
Quick Reference
快速参考
Geometric Operations (Offline Tools)
几何操作(离线工具)
- - Straight-line distance between two points
distance_tool - - Compass direction from A to B
bearing_tool - - Midpoint between two points
midpoint_tool - - Is point inside polygon?
point_in_polygon_tool - - Calculate polygon area
area_tool - - Create circular buffer/zone
buffer_tool - - Geometric center of polygon
centroid_tool - - Min/max coordinates of geometry
bbox_tool - - Reduce geometry complexity
simplify_tool
- - 两点间直线距离
distance_tool - - 从A到B的罗盘方向
bearing_tool - - 两点间中点
midpoint_tool - - 判断点是否在多边形内
point_in_polygon_tool - - 计算多边形面积
area_tool - - 创建圆形缓冲区/区域
buffer_tool - - 多边形几何中心
centroid_tool - - 几何图形的最小/最大坐标
bbox_tool - - 降低几何图形复杂度
simplify_tool
Routing & Navigation (APIs)
路径规划与导航(APIs)
- - Turn-by-turn routing
directions_tool - - Many-to-many travel times
matrix_tool - - Route optimization (TSP)
optimization_tool - - Travel-time zones
isochrone_tool - - Snap GPS to roads
map_matching_tool
- - 逐向导航
directions_tool - - 多对多行程时间
matrix_tool - - 路线优化(TSP)
optimization_tool - - 行程时间区域
isochrone_tool - - GPS轨迹匹配到道路
map_matching_tool
When to Use Each Category
各类工具的适用场景
Use Geometric Tools When:
- Problem is spatial/mathematical (containment, area, bearing)
- Straight-line distance is appropriate
- Need instant results for real-time checks
- Pure geometry (no roads/traffic involved)
Use Routing APIs When:
- Need actual driving/walking/cycling distances
- Need travel times
- Need to consider road networks
- Need traffic awareness
- Need route optimization
- Need turn-by-turn directions
使用几何工具的场景:
- 问题为空间/数学类(包含判断、面积、方位)
- 直线距离适用
- 需要实时检查的即时结果
- 纯几何问题(无道路/交通涉及)
使用路径规划API的场景:
- 需要实际驾驶/步行/骑行距离
- 需要行程时间
- 需要考虑道路网络
- 需要感知交通状况
- 需要路线优化
- 需要逐向导航
Integration with Other Skills
与其他技能的集成
Works with:
- mapbox-search-patterns: Search for locations, then use geospatial operations
- mapbox-web-performance-patterns: Optimize rendering of geometric calculations
- mapbox-token-security: Ensure requests use properly scoped tokens
可集成的技能:
- mapbox-search-patterns:搜索位置,然后进行地理空间操作
- mapbox-web-performance-patterns:优化几何计算的渲染性能
- mapbox-token-security:确保请求使用权限正确的令牌