update docs
This commit is contained in:
parent
248a786d7f
commit
1f21b86ae1
12
docs/http.md
12
docs/http.md
@ -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}
|
||||
@ -236,7 +236,8 @@ 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 the requested table or tables in response. Note that computing the `distances` table is currently only implemented for CH. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
|
||||
|
|
||||
|
||||
Unlike other array encoded options, the length of `sources` and `destinations` can be **smaller or equal**
|
||||
to number of input locations;
|
||||
@ -266,10 +267,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'
|
||||
```
|
||||
|
||||
@ -279,7 +280,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 computing the `distances` table is currently only implemented for CH. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
|
||||
- `sources` array of `Waypoint` objects describing all sources in order
|
||||
- `destinations` array of `Waypoint` objects describing all destinations in order
|
||||
|
||||
@ -288,6 +289,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.
|
||||
|
||||
|
||||
@ -126,7 +126,6 @@ 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.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)**
|
||||
|
||||
@ -143,7 +142,6 @@ 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.sources); // array of Waypoint objects
|
||||
console.log(response.destinations); // array of Waypoint objects
|
||||
});
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -274,17 +274,20 @@ NAN_METHOD(Engine::nearest) //
|
||||
* Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||
* @param {Array} [options.radiuses] Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||
* @param {Array} [options.hints] Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
* @param {Array} [options.sources] An array of `index` elements (`0 <= integer < #coordinates`) to
|
||||
* use
|
||||
* location with given index as source. Default is to use all.
|
||||
* @param {Array} [options.destinations] An array of `index` elements (`0 <= integer <
|
||||
* #coordinates`) to use location with given index as destination. Default is to use all.
|
||||
* @param {Array} [options.sources] An array of `index` elements (`0 <= integer < #coordinates`) to use
|
||||
* location with given index as source. Default is to use all.
|
||||
* @param {Array} [options.destinations] An array of `index` elements (`0 <= integer < #coordinates`) to use location with given index as destination. Default is to use all.
|
||||
* @param {Array} [options.approaches] Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||
* @param {Array} [options.annotations] An array of the table types to return. Values can be `duration` or `distance` or both. If no annotations parameter is added, the default is to return the `durations` table. If `annotations=distance` or `annotations=duration,distance` is requested when running a MLD router, a `NotImplemented` error will be returned.
|
||||
|
||||
* @param {Function} callback
|
||||
*
|
||||
* @returns {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 that computing the `distances` table is currently only implemented for CH. If `annotations=distance` or
|
||||
* `annotations=duration,distance` is requested when running a MLD router, 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.
|
||||
*
|
||||
@ -299,7 +302,7 @@ NAN_METHOD(Engine::nearest) //
|
||||
* };
|
||||
* 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 (currently only implemented for CH router)
|
||||
* console.log(response.sources); // array of Waypoint objects
|
||||
* console.log(response.destinations); // array of Waypoint objects
|
||||
* });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user