diff --git a/CHANGELOG.md b/CHANGELOG.md index cd63cd7ce..18f989b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ # 5.4.0 + Changes from 5.3.0 - Profiles - includes library guidance.lua that offers preliminary configuration on guidance. - Guidance - Handle Access tags for lanes, only considering valid lanes in lane-guidance (think car | car | bike | car) + - API: + - `annotations=true` now returns the data source id for each segment as `datasources` # 5.3.0 Changes from 5.3.0-rc.3 diff --git a/docs/http.md b/docs/http.md index d6ae028cb..c14d263e3 100644 --- a/docs/http.md +++ b/docs/http.md @@ -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