trueway-matrix
TrueWay Matrix MCP Server provides precise durations and distances between origins and destinations using TrueWay Directions.
TrueWay Matrix is a robust tool designed to calculate precise durations (in seconds) and distances (in meters) between a set of origins and destinations. It leverages the routes calculated by the TrueWay Directions tool, offering accurate estimations based on either predictive or live traffic data, depending on the start time specified in the request. This tool is essential for solving the Traveling Salesman Problem (TSP), addressing the Vehicle Routing Problem (VRP), sorting search results by actual travel distance or time, determining arrival times based on travel times, calculating commute time differences between locations, and clustering data based on travel time and distances.
Features
- Global Road Network Coverage: Access a comprehensive network for accurate distance and duration calculations.
- Traffic-Based Calculations: Optionally calculate traffic-influenced distance/duration matrices over specified timeframes.
- Route Preferences: Ability to avoid toll roads, highways, or ferries as per user requirements.
MCP Tools
- CalculateDrivingDistanceMatrix: Takes a list of origin and destination locations and returns a matrix of distances and durations between them.
Usage with Different Platforms
python
python
import requests
url = 'https://api.trueway.com/matrix'
params = {
'origins': '40.748817,-73.985428;34.052235,-118.243683',
'destinations': '37.774929,-122.419418;47.606209,-122.332069',
'start_time': 'now',
'avoid_highways': 'true'
}
response = requests.get(url, params=params)
data = response.json()
print(data)