Last week we pushed out Optimized Routing to our Directions Web Service beta. The week before that we introduced our new Directions Web Service. Today we're making the Route Matrix feature available.
A Route Matrix request in the Directions Web Service will return a quick and easy calculation of the distances and drive times between a bunch of points.
In the table below, we want to compare the times and distances between:
- York, PA
- Lancaster, PA
- Boalsburg, PA
- and Sunbury, PA
You'd ask the Directions Web Service something like this:
REQUEST URL:
http://platform.beta.mapquest.com/directions/v1/routematrix?key=YOUR_KEY_HERE
REQUEST BODY:
{
locations: [
"York, PA",
"Lancaster, PA",
"Boalsburg, PA",
"Sunbury, PA"
],
options: {
allToAll: true
}
}
And with the results, you could display something like this:
Driving distance (in miles)
|
York, PA | Lancaster, PA | Boalsburg, PA | Sunbury, PA | ||||
|---|---|---|---|---|---|---|---|---|
| York, PA | 0.00 | 25.68 | 107.85 | 78.45 | ||||
| Lancaster, PA | 25.92 | 0.00 | 120.64 | 91.25 | ||||
| Boalsburg, PA | 107.42 | 120.94 | 0.00 | 62.48 | ||||
| Sunbury, PA | 78.84 | 92.36 | 61.80 | 0.00 |
Driving times (in seconds)
|
York, PA | Lancaster, PA | Boalsburg, PA | Sunbury, PA | ||||
|---|---|---|---|---|---|---|---|---|
| York, PA | 0 | 2260 | 7253 | 5930 | ||||
| Lancaster, PA | 2348 | 0 | 7771 | 6448 | ||||
| Boalsburg, PA | 7350 | 7816 | 0 | 5098 | ||||
| Sunbury, PA | 6048 | 6514 | 5019 | 0 |
Check out the complete documentation for Route Matrix and the rest of the Directions Web Service Beta and please continue to send us your feedback.
