Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshkaj committed Apr 23, 2018
1 parent d0cee3b commit 32c42f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
11 changes: 6 additions & 5 deletions docs/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397

### Table service

Computes the duration of the fastest route between all pairs of supplied coordinates. Optionally, also returns the distances between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.
Computes the duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. Duration is in seconds and distances is in meters.

```endpoint
GET /table/v1/{profile}/{coordinates}?{sources}=[{elem}...];&{destinations}=[{elem}...]&annotations={duration|distance|duration,distance}
Expand All @@ -236,7 +236,7 @@ In addition to the [general options](#general-options) the following options are
|------------|--------------------------------------------------|---------------------------------------------|
|sources |`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as source. |
|destinations|`{index};{index}[;{index} ...]` or `all` (default)|Use location with given index as destination.|
|annotations |`duration` (default), `distance`, or `duration,distance`|Return additional table with distances to the response. Whether requested or not, the duration table is always returned.|
|annotations |`duration` (default), `distance`, or `duration,distance`|Return additional table with distances to the response. Whether requested or not, the duration table is always returned. Note that `distance` is only currently implemented for CH. Requesting it with MLD algorithm flag will return a `NotImplemented` error.|

Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
to number of input locations;
Expand Down Expand Up @@ -266,10 +266,10 @@ curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHu
# Returns a 3x3 duration matrix:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219&annotations=duration'
# Returns a 3x3 distance matrix:
# Returns a 3x3 distance matrix for CH:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219&annotations=distance'
# Returns a 3x3 duration matrix and a 3x3 distance matrix:
# Returns a 3x3 duration matrix and a 3x3 distance matrix for CH:
curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219&annotations=distance,duration'
```

Expand All @@ -279,7 +279,7 @@ curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
- `distances` array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found. Note that `distance` is only currently implemented for CH. Requesting it with MLD algorithm flag will return a `NotImplemented` error.
- `sources` array of `Waypoint` objects describing all sources in order
- `destinations` array of `Waypoint` objects describing all destinations in order

Expand All @@ -288,6 +288,7 @@ In case of error the following `code`s are supported in addition to the general
| Type | Description |
|------------------|-----------------|
| `NoTable` | No route found. |
| `NotImplemented` | This request is not supported |

All other properties might be undefined.

Expand Down
6 changes: 4 additions & 2 deletions docs/nodejs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ tables. Optionally returns distance table.
location with given index as source. Default is to use all.
- `options.destinations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer <
#coordinates`) to use location with given index as destination. Default is to use all.
- `options.annotations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of the table types to return. Values can be `duration` or `distance` or both. Default is to return only duration table.
- `options.annotations` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of the table types to return. Values can be `duration` or `distance` or both. Default is to return only duration table. Note: Currently, requesting a `distance` annotations is only supported for CH. If `annotations=distance` or `annotations=duration,distance` is requested, a `NotImplemented` error will be returned.
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**

Expand All @@ -143,7 +143,7 @@ var options = {
};
osrm.table(options, function(err, response) {
console.log(response.durations); // array of arrays, matrix in row-major order
console.log(response.distances); // array of arrays, matrix in row-major order
console.log(response.distances); // array of arrays, matrix in row-major order for CH
console.log(response.sources); // array of Waypoint objects
console.log(response.destinations); // array of Waypoint objects
});
Expand All @@ -152,6 +152,8 @@ osrm.table(options, function(err, response) {
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `sources`, and `destinations`.
**`durations`**: array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint.
Values are given in seconds.
**`distances`**: array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint.
Values are given in meters. Note: Currently, returning a `distances` result is only supported for CH. If `annotations=distance` or `annotations=duration,distance` is requested, a `NotImplemented` error will be returned.
**`sources`**: array of [`Ẁaypoint`](#waypoint) objects describing all sources in order.
**`destinations`**: array of [`Ẁaypoint`](#waypoint) objects describing all destinations in order.

Expand Down
2 changes: 1 addition & 1 deletion features/support/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function () {
.defer(rimraf, this.scenarioLogFile)
.awaitAll(callback);
// uncomment to get path to logfile
console.log(' Writing logging output to ' + this.scenarioLogFile);
// console.log(' Writing logging output to ' + this.scenarioLogFile);
});

this.After((scenario, callback) => {
Expand Down
3 changes: 2 additions & 1 deletion src/engine/plugins/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
if (request_distance && !algorithms.SupportsDistanceAnnotationType())
{
return Error("NotImplemented",
"The distance annotations calculation is not implemented for the chosen search algorithm.",
"The distance annotations calculation is not implemented for the chosen "
"search algorithm.",
result);
}

Expand Down

0 comments on commit 32c42f8

Please sign in to comment.