mapbox-geospatial-operations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mapbox 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:
  1. Offline Geometric Tools - Use Turf.js for pure geometric/spatial calculations
  2. 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提供两类地理空间工具:
  1. 离线几何工具 - 使用Turf.js进行纯几何/空间计算
  2. 路径规划与导航API - 当需要实际道路路径、交通状况或行程时间时,使用Mapbox API
关键问题:问题实际需要什么?

Decision Framework

决策框架

Problem CharacteristicTool CategoryWhy
Straight-line distance (as the crow flies)Offline geometricAccurate for geometric distance
Road/path distance (as the crow drives)Routing APIOnly routing APIs know road networks
Travel timeRouting APIRequires routing with speed/traffic data
Point containment (is X inside Y?)Offline geometricPure geometric operation
Geographic shapes (buffers, centroids, areas)Offline geometricMathematical/geometric operations
Traffic-aware routingRouting APIRequires real-time traffic data
Route optimization (best order to visit)Routing APIComplex routing algorithm
High-frequency checks (e.g., real-time geofencing)Offline geometricInstant 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 MeanTool ChoiceWhy
Straight-line distance (as the crow flies)
distance_tool
Accurate for geometric distance, instant
Driving distance (as the crow drives)
directions_tool
Only routing knows actual road distance
Walking/cycling distance (as the crow walks/bikes)
directions_tool
Need specific path network
Travel time
directions_tool
or
matrix_tool
Requires routing with speed data
Distance with current traffic
directions_tool
(driving-traffic)
Need real-time traffic consideration
Example: "What's the distance between these 5 warehouses?"
  • As the crow flies →
    distance_tool
    (10 calculations, instant)
  • As the crow drives →
    matrix_tool
    (5×5 matrix, one API call, returns actual route distances)
Key insight: Use the tool that matches what "distance" means in context. Always clarify: crow flies or crow drives?
用户提问:"X到Y有多远?"
用户实际需求工具选择原因
直线距离(直线飞行距离)
distance_tool
几何距离计算准确,即时返回
驾驶距离(实际驾驶路线距离)
directions_tool
只有路径规划工具能获取实际道路距离
步行/骑行距离(实际步行/骑行路线距离)
directions_tool
需要特定的路径网络数据
行程时间
directions_tool
matrix_tool
需要结合速度数据的路径规划
考虑当前交通状况的距离
directions_tool
(driving-traffic)
需要纳入实时交通状况考量
示例:"这5个仓库之间的距离是多少?"
  • 直线飞行距离 →
    distance_tool
    (10次计算,即时完成)
  • 实际驾驶距离 →
    matrix_tool
    (5×5矩阵,一次API调用,返回实际路线距离)
关键见解:选择与上下文"距离"含义匹配的工具。务必明确:是直线飞行距离还是实际驾驶距离?

Proximity and Containment

邻近性与包含判断

User asks: "Which points are near/inside this area?"
Query TypeTool ChoiceWhy
"Within X meters radius"
distance_tool
+ filter
Simple geometric radius
"Within X minutes drive"
isochrone_tool
point_in_polygon_tool
Need routing for travel-time zone, then geometric containment
"Inside this polygon"
point_in_polygon_tool
Pure geometric containment test
"Reachable by car in 30 min"
isochrone_tool
Requires routing + traffic
"Nearest to this point"
distance_tool
(geometric) or
matrix_tool
(routed)
Depends on definition of "nearest"
Example: "Are these 200 addresses in our 30-minute delivery zone?"
  1. Create zone →
    isochrone_tool
    (routing API - need travel time)
  2. Check addresses →
    point_in_polygon_tool
    (geometric - 200 instant checks)
Key insight: Routing for creating travel-time zones, geometric for containment checks
用户提问:"哪些点在这个区域附近/内部?"
查询类型工具选择原因
"在X米半径范围内"
distance_tool
+ 过滤
简单的几何半径计算
"在X分钟驾驶范围内"
isochrone_tool
point_in_polygon_tool
需要路径规划生成行程时间区域,再进行几何包含判断
"在这个多边形内部"
point_in_polygon_tool
纯几何包含性检验
"30分钟车程可达范围"
isochrone_tool
需要结合路径规划与交通数据
"离该点最近的点"
distance_tool
(几何计算)或
matrix_tool
(路径规划)
取决于"最近"的定义
示例:"这200个地址中哪些在我们30分钟配送范围内?"
  1. 生成配送区域 →
    isochrone_tool
    (路径规划API - 需要行程时间数据)
  2. 检查地址 →
    point_in_polygon_tool
    (200次几何检查即时完成)
关键见解:使用路径规划工具生成行程时间区域,使用几何工具进行快速包含判断

Routing and Navigation

路径规划与导航

User asks: "What's the best route?"
ScenarioTool ChoiceWhy
A to B directions
directions_tool
Turn-by-turn routing
Optimal order for multiple stops
optimization_tool
Solves traveling salesman problem
Clean GPS trace
map_matching_tool
Snaps to road network
Just need bearing/compass direction
bearing_tool
Simple geometric calculation
Route with traffic
directions_tool
(driving-traffic)
Real-time traffic awareness
Fixed-order waypoints
directions_tool
with 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的路线导航
directions_tool
逐向导航功能
多站点最优访问顺序
optimization_tool
解决旅行商问题
清理GPS轨迹
map_matching_tool
将轨迹匹配到道路网络上
仅需要方位/罗盘方向
bearing_tool
简单的几何计算
考虑交通状况的路线
directions_tool
(driving-traffic)
实时交通感知
固定顺序的途经点路线
directions_tool
结合途经点参数
途经指定点的路径规划
示例:"从酒店导航到机场"
  • 需要逐向导航 →
    directions_tool
  • 仅需要知道"在东北方向" →
    bearing_tool
关键见解:路径规划工具用于实际导航,几何工具用于方位信息获取

Area and Shape Operations

区域与形状操作

User asks: "Create a zone around this location"
RequirementTool ChoiceWhy
Simple circular buffer
buffer_tool
Geometric circle/radius
Travel-time zone
isochrone_tool
Based on routing network
Calculate area size
area_tool
Geometric calculation
Simplify complex boundary
simplify_tool
Geometric simplification
Find center of shape
centroid_tool
Geometric centroid
Example: "Show 5km coverage around each store"
  • 5km radius →
    buffer_tool
    (geometric circles)
  • "What customers can reach in 15 min?" →
    isochrone_tool
    (routing-based)
Key insight: Geometric tools for distance-based zones, routing tools for time-based zones
用户提问:"在该位置周围生成一个区域"
需求工具选择原因
简单圆形缓冲区
buffer_tool
几何圆形/半径计算
行程时间区域
isochrone_tool
基于路径规划网络生成
计算区域面积
area_tool
几何计算
简化复杂边界
simplify_tool
几何简化操作
查找形状中心
centroid_tool
几何质心计算
示例:"展示每家门店周边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 CaseApproachTool Choice
Real-time geofencing (every second)Geometric checks
point_in_polygon_tool
(instant)
Route planning (one-time)Full routing
directions_tool
or
optimization_tool
Periodic proximity checksGeometric distance
distance_tool
Live traffic routingRouting with traffic
directions_tool
(driving-traffic)
用例处理方式工具选择
实时地理围栏(每秒检查一次)几何检查
point_in_polygon_tool
(即时完成)
一次性路线规划完整路径规划
directions_tool
optimization_tool
周期性邻近性检查几何距离计算
distance_tool
实时交通路线规划带交通的路径规划
directions_tool
(driving-traffic)

Common Scenarios and Optimal Approaches

常见场景与最优方案

Scenario 1: Store Locator

场景1:门店定位器

User: "Find the closest store and show 5km coverage"
Optimal approach:
  1. Search stores →
    category_search_tool
    (returns distances automatically)
  2. Create coverage zone →
    buffer_tool
    (5km geometric circle)
  3. Visualize →
    static_map_image_tool
Why: Search already gives distances; geometric buffer for simple radius
用户:"找到最近的门店并展示5公里覆盖范围"
最优方案:
  1. 搜索门店 →
    category_search_tool
    (自动返回距离)
  2. 生成覆盖区域 →
    buffer_tool
    (5公里几何圆形)
  3. 可视化 →
    static_map_image_tool
原因:搜索工具已返回距离;几何缓冲区适合简单半径区域

Scenario 2: Delivery Route Optimization

场景2:配送路线优化

User: "Optimize delivery to 8 addresses"
Optimal approach:
  1. Geocode addresses →
    search_and_geocode_tool
  2. Optimize route →
    optimization_tool
    (TSP solver with routing)
Why: Need actual routing for turn-by-turn delivery, not geometric distances
用户:"优化8个地址的配送路线"
最优方案:
  1. 地址地理编码 →
    search_and_geocode_tool
  2. 路线优化 →
    optimization_tool
    (带路径规划的TSP求解器)
原因:需要实际导航路线用于配送,而非几何距离

Scenario 3: Service Area Validation

场景3:服务区域验证

User: "Which of these 200 addresses can we deliver to in 30 minutes?"
Optimal approach:
  1. Create delivery zone →
    isochrone_tool
    (30-minute driving)
  2. Check each address →
    point_in_polygon_tool
    (200 geometric checks)
Why: Routing for accurate travel-time zone, geometric for fast containment checks
用户:"这200个地址中哪些能在30分钟内送达?"
最优方案:
  1. 生成配送区域 →
    isochrone_tool
    (30分钟驾驶范围)
  2. 检查每个地址 →
    point_in_polygon_tool
    (200次几何检查)
原因:路径规划工具生成准确的行程时间区域,几何工具快速完成包含判断

Scenario 4: GPS Trace Analysis

场景4:GPS轨迹分析

User: "How long was this bike ride?"
Optimal approach:
  1. Clean GPS trace →
    map_matching_tool
    (snap to bike paths)
  2. Get distance → Use API response or calculate with
    distance_tool
Why: Need road/path matching; distance calculation either way works
用户:"这次骑行有多长?"
最优方案:
  1. 清理GPS轨迹 →
    map_matching_tool
    (匹配到自行车道)
  2. 获取距离 → 使用API响应或
    distance_tool
    计算
原因:需要路径匹配;两种方式均可计算距离

Scenario 5: Coverage Analysis

场景5:覆盖范围分析

User: "What's our total service area?"
Optimal approach:
  1. Create buffers around each location →
    buffer_tool
  2. Calculate total area →
    area_tool
  3. Or, if time-based →
    isochrone_tool
    for each location
Why: Geometric for distance-based coverage, routing for time-based
用户:"我们的总服务区域是多少?"
最优方案:
  1. 在每个位置周围生成缓冲区 →
    buffer_tool
  2. 计算总面积 →
    area_tool
  3. 若为基于时间的范围 → 为每个位置使用
    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 drives
Why 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 route
Use 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 time
Use 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:
  1. 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
  2. Does the user need travel time?
    • Yes → routing APIs (only they know speeds/traffic)
    • No → geometric tools may suffice
  3. Is this about roads/paths or pure spatial relationships?
    • Roads/paths → routing APIs
    • Spatial relationships → geometric tools
  4. 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)
  5. Is accuracy critical, or is approximation OK?
    • Critical + routing → routing APIs
    • Approximation OK → geometric tools may work
选择工具前,需明确:
  1. "距离"指的是直线飞行距离还是实际驾驶距离?
    • 直线飞行距离 → 几何工具
    • 实际驾驶距离 → 路径规划API
  2. 用户是否需要行程时间?
    • 是 → 路径规划API(只有它们能获取速度/交通数据)
    • 否 → 几何工具可能足够
  3. 问题是关于道路/路径还是纯空间关系?
    • 道路/路径 → 路径规划API
    • 空间关系 → 几何工具
  4. 是否需要实时低延迟处理?
    • 是 + 几何问题 → 离线工具(即时)
    • 是 + 路径规划问题 → 使用路径规划API(仍快速)
  5. 精度是否关键,还是近似值即可?
    • 关键 + 路径规划 → 路径规划API
    • 近似值即可 → 几何工具可能适用

Terminology Guide

术语指南

Understanding what users mean:
User SaysUsually MeansTool 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 containmentGeometric
"Navigate/directions"Turn-by-turn routingRouting API
"Bearing/direction"Compass direction (crow flies)Geometric
理解用户表述的含义:
用户表述通常含义工具类型
"距离"取决于上下文!需明确:是直线飞行还是实际驾驶?不确定
"有多远"通常指实际驾驶距离路径规划API
"附近"通常指直线飞行距离(半径范围)几何工具
"近"可能是两者之一,需确认!需询问用户
"可达"基于行程时间(考虑交通的实际驾驶)路径规划API
"在内部/包含"几何包含关系几何工具
"导航/路线"逐向导航路径规划API
"方位/方向"罗盘方向(直线飞行)几何工具

Quick Reference

快速参考

Geometric Operations (Offline Tools)

几何操作(离线工具)

  • distance_tool
    - Straight-line distance between two points
  • bearing_tool
    - Compass direction from A to B
  • midpoint_tool
    - Midpoint between two points
  • point_in_polygon_tool
    - Is point inside polygon?
  • area_tool
    - Calculate polygon area
  • buffer_tool
    - Create circular buffer/zone
  • centroid_tool
    - Geometric center of polygon
  • bbox_tool
    - Min/max coordinates of geometry
  • simplify_tool
    - Reduce geometry complexity
  • distance_tool
    - 两点间直线距离
  • bearing_tool
    - 从A到B的罗盘方向
  • midpoint_tool
    - 两点间中点
  • point_in_polygon_tool
    - 判断点是否在多边形内
  • area_tool
    - 计算多边形面积
  • buffer_tool
    - 创建圆形缓冲区/区域
  • centroid_tool
    - 多边形几何中心
  • bbox_tool
    - 几何图形的最小/最大坐标
  • simplify_tool
    - 降低几何图形复杂度

Routing & Navigation (APIs)

路径规划与导航(APIs)

  • directions_tool
    - Turn-by-turn routing
  • matrix_tool
    - Many-to-many travel times
  • optimization_tool
    - Route optimization (TSP)
  • isochrone_tool
    - Travel-time zones
  • map_matching_tool
    - Snap GPS to roads
  • directions_tool
    - 逐向导航
  • matrix_tool
    - 多对多行程时间
  • optimization_tool
    - 路线优化(TSP)
  • isochrone_tool
    - 行程时间区域
  • map_matching_tool
    - GPS轨迹匹配到道路

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:确保请求使用权限正确的令牌

Resources

资源