Reformated the docs for annotations

This commit is contained in:
Patrick Niklaus
2016-07-25 12:51:21 +02:00
committed by Daniel Patterson
parent 280b000f07
commit 14797c421e
2 changed files with 25 additions and 10 deletions
+22 -10
View File
@@ -399,8 +399,8 @@ Represents a route between two waypoints.
| annotations | |
|--------------|-----------------------------------------------------------------------|
| true | returns distance and durations of each coordinate along the route |
| false | will not exist |
| true | An `Annotation` object containing node ids, durations and distances |
| false | `undefined` |
#### Example
@@ -420,16 +420,28 @@ With `steps=false` and `annotations=true`:
}
```
#### Annotation data
### Annotation
Several fields are available as annotations. They are:
Annotation of the whole route leg with fine-grained information about each segment or node id.
#### Properties
- `distance`: The distance, in metres, between each pair of coordinates
- `duration`: The duration between each pair of coordinates, in seconds
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
#### Example
```json
{
"distance": [5,5,10,5,5],
"duration": [15,15,40,15,15],
"datasources": [1,0,0,0,1],
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
}
```
| field | description |
|-------------|---------------------------------------------------------------------------------------------------------|
| distance | the distance, in metres, between each pair of coordinates |
| duration | the duration between each pair of coordinates, in seconds |
| datasources | the index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract` |
| nodes | the OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates |
### RouteStep