#5325 Documentation changes and some fix for flatbuffers
This commit is contained in:
parent
c2015a8393
commit
d69d0c2fe6
@ -208,7 +208,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
||||
|alternatives|`true`, `false` (default), or Number |Search for alternative routes. Passing a number `alternatives=n` searches for up to `n` alternative routes.\* |
|
||||
|steps |`true`, `false` (default) |Returned route steps for each route leg |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `ways`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
||||
@ -430,7 +430,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||
|steps |`true`, `false` (default) |Returned route steps for each route |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `ways`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|
||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||
@ -486,7 +486,7 @@ In addition to the [general options](#general-options) the following options are
|
||||
|source |`any` (default), `first` |Returned route starts at `any` or `first` coordinate |
|
||||
|destination |`any` (default), `last` |Returned route ends at `any` or `last` coordinate |
|
||||
|steps |`true`, `false` (default) |Returned route instructions for each trip |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `ways`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|
||||
@ -700,6 +700,7 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
- `duration`: The duration between each pair of coordinates, in seconds. Does not include the duration of any turns.
|
||||
- `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` or `osrm-customize`. String-like names are in the `metadata.datasource_names` array.
|
||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||
- `ways`: The OSM way ID for each pair of neighbour nodes in the list of nodes
|
||||
- `weight`: The weights between each pair of coordinates. Does not include any turn costs.
|
||||
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
||||
- `metadata`: Metadata related to other annotations
|
||||
@ -714,6 +715,7 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
"datasources": [1,0,0,0,1],
|
||||
"metadata": { "datasource_names": ["traffic","lua profile","lua profile","lua profile","traffic"] },
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||
"ways": [130764281,130764281,6056749,6056749,6056749],
|
||||
"weight": [15,15,40,15,15]
|
||||
}
|
||||
```
|
||||
|
||||
@ -55,7 +55,7 @@ Returns the fastest route between two or more coordinates while visiting the way
|
||||
- `options.alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
||||
_Please note that even if alternative routes are requested, a result cannot be guaranteed._ (optional, default `0`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route leg. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `ways`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.continue_straight` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.
|
||||
@ -215,7 +215,7 @@ if they can not be matched successfully.
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `ways`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.timestamps` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>?** Timestamp of the input location (integers, UNIX-like timestamp).
|
||||
@ -282,7 +282,7 @@ Right now, the following combinations are possible:
|
||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `ways`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||
- `options.roundtrip` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route is a roundtrip. (optional, default `true`)
|
||||
|
||||
@ -461,8 +461,8 @@ struct AnnotationT : public flatbuffers::NativeTable {
|
||||
std::vector<uint32_t> distance;
|
||||
std::vector<uint32_t> duration;
|
||||
std::vector<uint32_t> datasources;
|
||||
std::vector<uint32_t> nodes;
|
||||
std::vector<uint32_t> ways;
|
||||
std::vector<uint64_t> nodes;
|
||||
std::vector<uint64_t> ways;
|
||||
std::vector<uint32_t> weight;
|
||||
std::vector<float> speed;
|
||||
std::unique_ptr<osrm::engine::api::fbresult::MetadataT> metadata;
|
||||
@ -491,11 +491,11 @@ struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<uint32_t> *datasources() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint32_t> *>(VT_DATASOURCES);
|
||||
}
|
||||
const flatbuffers::Vector<uint32_t> *nodes() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint32_t> *>(VT_NODES);
|
||||
const flatbuffers::Vector<uint64_t> *nodes() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_NODES);
|
||||
}
|
||||
const flatbuffers::Vector<uint32_t> *ways() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint32_t> *>(VT_WAYS);
|
||||
const flatbuffers::Vector<uint64_t> *ways() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_WAYS);
|
||||
}
|
||||
const flatbuffers::Vector<uint32_t> *weight() const {
|
||||
return GetPointer<const flatbuffers::Vector<uint32_t> *>(VT_WEIGHT);
|
||||
@ -543,10 +543,10 @@ struct AnnotationBuilder {
|
||||
void add_datasources(flatbuffers::Offset<flatbuffers::Vector<uint32_t>> datasources) {
|
||||
fbb_.AddOffset(Annotation::VT_DATASOURCES, datasources);
|
||||
}
|
||||
void add_nodes(flatbuffers::Offset<flatbuffers::Vector<uint32_t>> nodes) {
|
||||
void add_nodes(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> nodes) {
|
||||
fbb_.AddOffset(Annotation::VT_NODES, nodes);
|
||||
}
|
||||
void add_ways(flatbuffers::Offset<flatbuffers::Vector<uint32_t>> ways) {
|
||||
void add_ways(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> ways) {
|
||||
fbb_.AddOffset(Annotation::VT_WAYS, ways);
|
||||
}
|
||||
void add_weight(flatbuffers::Offset<flatbuffers::Vector<uint32_t>> weight) {
|
||||
@ -575,8 +575,8 @@ inline flatbuffers::Offset<Annotation> CreateAnnotation(
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> distance = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> duration = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> datasources = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> nodes = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> ways = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint64_t>> nodes = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint64_t>> ways = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<uint32_t>> weight = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<float>> speed = 0,
|
||||
flatbuffers::Offset<osrm::engine::api::fbresult::Metadata> metadata = 0) {
|
||||
@ -597,16 +597,16 @@ inline flatbuffers::Offset<Annotation> CreateAnnotationDirect(
|
||||
const std::vector<uint32_t> *distance = nullptr,
|
||||
const std::vector<uint32_t> *duration = nullptr,
|
||||
const std::vector<uint32_t> *datasources = nullptr,
|
||||
const std::vector<uint32_t> *nodes = nullptr,
|
||||
const std::vector<uint32_t> *ways = nullptr,
|
||||
const std::vector<uint64_t> *nodes = nullptr,
|
||||
const std::vector<uint64_t> *ways = nullptr,
|
||||
const std::vector<uint32_t> *weight = nullptr,
|
||||
const std::vector<float> *speed = nullptr,
|
||||
flatbuffers::Offset<osrm::engine::api::fbresult::Metadata> metadata = 0) {
|
||||
auto distance__ = distance ? _fbb.CreateVector<uint32_t>(*distance) : 0;
|
||||
auto duration__ = duration ? _fbb.CreateVector<uint32_t>(*duration) : 0;
|
||||
auto datasources__ = datasources ? _fbb.CreateVector<uint32_t>(*datasources) : 0;
|
||||
auto nodes__ = nodes ? _fbb.CreateVector<uint32_t>(*nodes) : 0;
|
||||
auto ways__ = ways ? _fbb.CreateVector<uint32_t>(*ways) : 0;
|
||||
auto nodes__ = nodes ? _fbb.CreateVector<uint64_t>(*nodes) : 0;
|
||||
auto ways__ = ways ? _fbb.CreateVector<uint64_t>(*ways) : 0;
|
||||
auto weight__ = weight ? _fbb.CreateVector<uint32_t>(*weight) : 0;
|
||||
auto speed__ = speed ? _fbb.CreateVector<float>(*speed) : 0;
|
||||
return osrm::engine::api::fbresult::CreateAnnotation(
|
||||
|
||||
@ -9,8 +9,8 @@ table Annotation {
|
||||
distance: [uint];
|
||||
duration: [uint];
|
||||
datasources: [uint];
|
||||
nodes: [uint];
|
||||
ways: [uint];
|
||||
nodes: [ulong];
|
||||
ways: [ulong];
|
||||
weight: [uint];
|
||||
speed: [float];
|
||||
metadata: Metadata;
|
||||
|
||||
@ -494,7 +494,7 @@ class RouteAPI : public BaseAPI
|
||||
return anno.datasource;
|
||||
});
|
||||
}
|
||||
std::vector<uint32_t> nodes;
|
||||
std::vector<uint64_t> nodes;
|
||||
if (requested_annotations & RouteParameters::AnnotationsType::Nodes)
|
||||
{
|
||||
nodes.reserve(leg_geometry.osm_node_ids.size());
|
||||
@ -503,7 +503,7 @@ class RouteAPI : public BaseAPI
|
||||
nodes.emplace_back(static_cast<uint64_t>(node_id));
|
||||
}
|
||||
}
|
||||
std::vector<uint32_t> ways;
|
||||
std::vector<uint64_t> ways;
|
||||
if (requested_annotations & RouteParameters::AnnotationsType::Ways)
|
||||
{
|
||||
ways.reserve(leg_geometry.osm_way_ids.size());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user