diff --git a/docs/http.md b/docs/http.md index 7aa616444..80b426d3f 100644 --- a/docs/http.md +++ b/docs/http.md @@ -275,7 +275,7 @@ In addition to the [general options](#general-options) the following options are |geometries |`polyline` (default), `geojson` |Returned route geometry format (influences overview and per step) | |annotations |`true`, `false` (default) |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} ...]` |Timestamp of the input location. | +|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamp of the input location. Timestamps need to be monotonically increasing. | |radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.| |Parameter |Values | diff --git a/src/engine/plugins/match.cpp b/src/engine/plugins/match.cpp index c544cf3f0..83a50b66f 100644 --- a/src/engine/plugins/match.cpp +++ b/src/engine/plugins/match.cpp @@ -12,6 +12,8 @@ #include #include +#include +#include #include #include #include @@ -123,6 +125,16 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr{}); + + if (!time_increases_monotonically) + { + return Error("InvalidValue", "Timestamps need to be monotonically increasing.", json_result); + } + // assuming radius is the standard deviation of a normal distribution // that models GPS noise (in this model), x3 should give us the correct // search radius with > 99% confidence