Skip to content

Commit 09ff160

Browse files
committed
Revert previous commits for cleaner approach
1 parent 7dfa2bd commit 09ff160

File tree

18 files changed

+82
-229
lines changed

18 files changed

+82
-229
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Unreleased
22
- Changes from 5.27.1
3-
- API:
4-
- CHANGED: Require a `radius` parameter when using `bearings`. [#6572](https://github.com/Project-OSRM/osrm-backend/pull/6572)
53
- Build:
64
- ADDED: Add CI job which builds OSRM with gcc 12. [#6455](https://github.com/Project-OSRM/osrm-backend/pull/6455)
75
- CHANGED: Upgrade to clang-tidy 15. [#6439](https://github.com/Project-OSRM/osrm-backend/pull/6439)

docs/http.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To pass parameters to each location some options support an array-like encoding:
3131

3232
| Option | Values | Description |
3333
|----------------|--------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
34-
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in a clockwise direction. Requires a corresponding radius. |
34+
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in a clockwise direction. |
3535
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
3636
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
3737
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |

docs/nodejs/api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ var osrm = new OSRM('network.osrm');
111111
var options = {
112112
coordinates: [[13.388860,52.517037]],
113113
number: 3,
114-
bearings: [[0,20]],
115-
radiuses: [null]
114+
bearings: [[0,20]]
116115
};
117116
osrm.nearest(options, function(err, response) {
118117
console.log(response.waypoints); // array of Waypoint objects

features/car/startpoint.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ Feature: Car - Allowed start/end modes
7070
Given the query options
7171
| snapping | any |
7272
| bearings | 90,180; |
73-
| radiuses | unlimited; |
7473

7574
And the ways
7675
| nodes | highway | access |
@@ -113,7 +112,6 @@ Feature: Car - Allowed start/end modes
113112
Given the query options
114113
| snapping | any |
115114
| bearings | 90,180;0,180;; |
116-
| radiuses | unlimited;;; |
117115

118116
And the ways
119117
| nodes | highway | access |

features/support/route.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ module.exports = function () {
6666
if (bs.length === 2) return b;
6767
else return b += ',10';
6868
}).join(';');
69-
params.radiuses = bearings.map(() => {
70-
return 'unlimited';
71-
}).join(';');
7269
}
7370

7471
if (approaches.length) {

features/testbot/annotations.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ Feature: Annotations
112112
And the query options
113113
| annotations | speed,distance,duration,nodes |
114114
| bearings | 90,5;180,5 |
115-
| radiuses | unlimited;unlimited |
116115

117116
When I route I should get
118-
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
117+
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
119118
| a | c | abc,abc | 10:10 | 249.9876189:299.962882 | 25:30 | 1:2:3 |

include/engine/api/base_parameters.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ struct BaseParameters
106106
bool IsValid() const
107107
{
108108
return (hints.empty() || hints.size() == coordinates.size()) &&
109-
(bearings.empty() || bearings.size() == radiuses.size()) &&
109+
(bearings.empty() || bearings.size() == coordinates.size()) &&
110110
(radiuses.empty() || radiuses.size() == coordinates.size()) &&
111111
(approaches.empty() || approaches.size() == coordinates.size()) &&
112112
std::all_of(bearings.begin(),

include/nodejs/node_osrm_support.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,6 @@ inline bool argumentsToParameter(const Napi::CallbackInfo &args,
522522
if (bearings.IsEmpty())
523523
return false;
524524

525-
if (!obj.Has("radiuses"))
526-
{
527-
ThrowError(args.Env(), "Bearings must be accompanied with radiuses");
528-
return false;
529-
}
530-
531525
if (!bearings.IsArray())
532526
{
533527
ThrowError(args.Env(), "Bearings must be an array of arrays of numbers");

include/server/service/utils.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@ namespace osrm::server::service
44
{
55

66
const constexpr char PARAMETER_SIZE_MISMATCH_MSG[] =
7-
"Number of elements in %1% size %2% does not match %3% size %4%";
7+
"Number of elements in %1% size %2% does not match coordinate size %3%";
88

99
template <typename ParamT>
1010
bool constrainParamSize(const char *msg_template,
11-
const char *param_name,
11+
const char *name,
1212
const ParamT &param,
13-
const char *target_name,
1413
const std::size_t target_size,
1514
std::string &help)
1615
{
1716
if (param.size() > 0 && param.size() != target_size)
1817
{
19-
help = (boost::format(msg_template) % param_name % param.size() % target_name % target_size)
20-
.str();
18+
help = (boost::format(msg_template) % name % param.size() % target_size).str();
2119
return true;
2220
}
2321
return false;

src/engine/plugins/table.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
4343
"InvalidOptions", "Number of bearings does not match number of coordinates", result);
4444
}
4545

46-
if (!params.bearings.empty() && params.radiuses.size() != params.bearings.size())
47-
{
48-
return Error(
49-
"InvalidOptions", "Number of radiuses does not match number of bearings", result);
50-
}
51-
5246
// Empty sources or destinations means the user wants all of them included, respectively
5347
// The ManyToMany routing algorithm we dispatch to below already handles this perfectly.
5448
const auto num_sources =

0 commit comments

Comments
 (0)