Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17e19663ba | |||
| 5597415f28 | |||
| 5476f6ab27 | |||
| 0971f06193 | |||
| 85515f063a | |||
| 69d7825542 | |||
| 9b779c704f | |||
| 5bd7d04fe3 | |||
| 0f78f7b2cc | |||
| 8473be69d2 | |||
| c0124f7d77 | |||
| b630b4e32a | |||
| 89fabc1b9c | |||
| a649a8a5cf | |||
| f928956584 | |||
| 7ff68792d7 | |||
| 3088dd0342 | |||
| d2590989f5 | |||
| 3a7b377586 | |||
| 82b5648c97 | |||
| 1628a3c4d5 | |||
| e5d8319c43 | |||
| 06699132eb | |||
| 918e794d6a | |||
| 8dd8ee1fc2 | |||
| c3d0efda93 |
+1
-1
@@ -13,7 +13,7 @@ notifications:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- "5.18"
|
||||
- "5.19"
|
||||
# enable building tags
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
|
||||
|
||||
+12
-1
@@ -1,7 +1,18 @@
|
||||
# 5.18.1
|
||||
# 5.19.0
|
||||
- Changes from 5.18.0:
|
||||
- Optimizations:
|
||||
- CHANGED: Use Grisu2 for serializing floating point numbers. [#5188](https://github.com/Project-OSRM/osrm-backend/pull/5188)
|
||||
- ADDED: Node bindings can return pre-rendered JSON buffer. [#5189](https://github.com/Project-OSRM/osrm-backend/pull/5189)
|
||||
- Profiles:
|
||||
- CHANGED: Bicycle profile now blacklists barriers instead of whitelisting them [#5076
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5076/)
|
||||
- CHANGED: Foot profile now blacklists barriers instead of whitelisting them [#5077
|
||||
](https://github.com/Project-OSRM/osrm-backend/pull/5077/)
|
||||
- CHANGED: Support maxlength and maxweight in car profile [#5101](https://github.com/Project-OSRM/osrm-backend/pull/5101]
|
||||
- Bugfixes:
|
||||
- FIXED: collapsing of ExitRoundabout instructions [#5114](https://github.com/Project-OSRM/osrm-backend/issues/5114)
|
||||
- Misc:
|
||||
- CHANGED: Support up to 512 named shared memory regions [#5185](https://github.com/Project-OSRM/osrm-backend/pull/5185)
|
||||
|
||||
# 5.18.0
|
||||
- Changes from 5.17.0:
|
||||
|
||||
+2
-2
@@ -138,7 +138,7 @@ Given an OpenStreetMap way, the `process_way` function will either return nothin
|
||||
Argument | Description
|
||||
---------|-------------------------------------------------------
|
||||
profile | The configuration table you returned in `setup`.
|
||||
node | The input way to process (read-only).
|
||||
way | The input way to process (read-only).
|
||||
result | The output that you will modify.
|
||||
relations| Storage of relations to access relations, where `way` is a member.
|
||||
|
||||
@@ -199,7 +199,7 @@ source.lon | Read | Float | Co-ordinates of segment start
|
||||
source.lat | Read | Float | ""
|
||||
target.lon | Read | Float | Co-ordinates of segment end
|
||||
target.lat | Read | Float | ""
|
||||
target.distance | Read | Float | Length of segment
|
||||
distance | Read | Float | Length of segment
|
||||
weight | Read/write | Float | Routing weight for this segment
|
||||
duration | Read/write | Float | Duration for this segment
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Barriers
|
||||
| entrance | x |
|
||||
| wall | |
|
||||
| fence | |
|
||||
| some_tag | |
|
||||
| some_tag | x |
|
||||
| block | x |
|
||||
|
||||
Scenario: Bike - Access tag trumphs barriers
|
||||
|
||||
@@ -48,3 +48,22 @@ Feature: Car - Handle physical limitation
|
||||
| primary | | none | x |
|
||||
| primary | | no-sign | x |
|
||||
| primary | | unsigned | x |
|
||||
|
||||
Scenario: Car - Limited by length
|
||||
Then routability should be
|
||||
| highway | maxlength | bothw |
|
||||
| primary | | x |
|
||||
| primary | 1 | |
|
||||
| primary | 5 | x |
|
||||
| primary | unsigned | x |
|
||||
|
||||
Scenario: Car - Limited by weight
|
||||
Then routability should be
|
||||
| highway | maxweight | bothw |
|
||||
| primary | | x |
|
||||
| primary | 1 | |
|
||||
| primary | 3.5 | x |
|
||||
| primary | 35000 kg | x |
|
||||
| primary | 8.9t | x |
|
||||
| primary | 0.1 lbs | |
|
||||
| primary | unsigned | x |
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Barriers
|
||||
| entrance | x |
|
||||
| wall | |
|
||||
| fence | |
|
||||
| some_tag | |
|
||||
| some_tag | x |
|
||||
| block | x |
|
||||
|
||||
Scenario: Foot - Access tag trumphs barriers
|
||||
|
||||
@@ -62,12 +62,14 @@ template <> v8::Local<v8::Value> inline render(const ObjectOrString &result)
|
||||
{
|
||||
if (result.is<osrm::json::Object>())
|
||||
{
|
||||
// Convert osrm::json object tree into matching v8 object tree
|
||||
v8::Local<v8::Value> value;
|
||||
renderToV8(value, result.get<osrm::json::Object>());
|
||||
return value;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return the string object as a node Buffer
|
||||
return Nan::CopyBuffer(result.get<std::string>().data(), result.get<std::string>().size())
|
||||
.ToLocalChecked();
|
||||
}
|
||||
@@ -871,10 +873,6 @@ argumentsToPluginParameters(const Nan::FunctionCallbackInfo<v8::Value> &args)
|
||||
return {};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "No format on config" << std::endl;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ template <typename Data> struct SharedMonitor
|
||||
// like two-turnstile reusable barrier or boost/interprocess/sync/spin/condition.hpp
|
||||
// fail if a waiter is killed.
|
||||
|
||||
// Buffer size needs to be large enough to hold all the semaphores for every
|
||||
// listener you want to support.
|
||||
static constexpr int buffer_size = 4096 * 4;
|
||||
|
||||
struct InternalData
|
||||
|
||||
@@ -247,9 +247,8 @@ inline DiyFp GetCachedPower(int e, int *K)
|
||||
inline void
|
||||
GrisuRound(char *buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w)
|
||||
{
|
||||
while (rest < wp_w && delta - rest >= ten_kappa &&
|
||||
(rest + ten_kappa < wp_w || /// closer
|
||||
wp_w - rest > rest + ten_kappa - wp_w))
|
||||
while (rest < wp_w && delta - rest >= ten_kappa && (rest + ten_kappa < wp_w || /// closer
|
||||
wp_w - rest > rest + ten_kappa - wp_w))
|
||||
{
|
||||
buffer[len - 1]--;
|
||||
rest += ten_kappa;
|
||||
|
||||
@@ -81,19 +81,6 @@ struct String
|
||||
std::string value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Typed string wrapper.
|
||||
*
|
||||
* Unwrap the type via its value member attribute.
|
||||
*/
|
||||
struct Buffer
|
||||
{
|
||||
Buffer() = default;
|
||||
Buffer(const char *value_) : value{value_} {}
|
||||
Buffer(std::string value_) : value{std::move(value_)} {}
|
||||
std::string value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Typed floating point number.
|
||||
*
|
||||
|
||||
@@ -22,6 +22,11 @@ namespace util
|
||||
namespace json
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int MAX_FLOAT_STRING_LENGTH = 256;
|
||||
}
|
||||
|
||||
struct Renderer
|
||||
{
|
||||
explicit Renderer(std::ostream &_out) : out(_out) {}
|
||||
@@ -35,13 +40,13 @@ struct Renderer
|
||||
|
||||
void operator()(const Number &number) const
|
||||
{
|
||||
char buffer[256] = {'\0'};
|
||||
char buffer[MAX_FLOAT_STRING_LENGTH] = {'\0'};
|
||||
ieee754::dtoa_milo(number.value, buffer);
|
||||
|
||||
// Trucate to 10 decimal places
|
||||
int pos = 0;
|
||||
int decimalpos = 0;
|
||||
while (decimalpos == 0 && pos < 256 && buffer[pos] != 0)
|
||||
while (decimalpos == 0 && pos < MAX_FLOAT_STRING_LENGTH && buffer[pos] != 0)
|
||||
{
|
||||
if (buffer[pos] == '.')
|
||||
{
|
||||
@@ -50,7 +55,7 @@ struct Renderer
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
while (pos < 256 && buffer[pos] != 0)
|
||||
while (pos < MAX_FLOAT_STRING_LENGTH && buffer[pos] != 0)
|
||||
{
|
||||
if (pos - decimalpos == 10)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "osrm",
|
||||
"version": "5.18.0-moarshm.5",
|
||||
"version": "5.19.0",
|
||||
"private": false,
|
||||
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
||||
"dependencies": {
|
||||
|
||||
+5
-15
@@ -38,20 +38,10 @@ function setup()
|
||||
mode.pushing_bike
|
||||
},
|
||||
|
||||
barrier_whitelist = Set {
|
||||
'sump_buster',
|
||||
'bus_trap',
|
||||
'cycle_barrier',
|
||||
'bollard',
|
||||
'entrance',
|
||||
'cattle_grid',
|
||||
'border_control',
|
||||
'toll_booth',
|
||||
'sally_port',
|
||||
'gate',
|
||||
'lift_gate',
|
||||
'no',
|
||||
'block'
|
||||
barrier_blacklist = Set {
|
||||
'yes',
|
||||
'wall',
|
||||
'fence'
|
||||
},
|
||||
|
||||
access_tag_whitelist = Set {
|
||||
@@ -245,7 +235,7 @@ function process_node(profile, node, result)
|
||||
else
|
||||
local barrier = node:get_value_by_key("barrier")
|
||||
if barrier and "" ~= barrier then
|
||||
if not profile.barrier_whitelist[barrier] then
|
||||
if profile.barrier_blacklist[barrier] then
|
||||
result.barrier = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,6 +42,10 @@ function setup()
|
||||
vehicle_height = 2.5, -- in meters, 2.5m is the height of van
|
||||
vehicle_width = 1.9, -- in meters, ways with narrow tag are considered narrower than 2.2m
|
||||
|
||||
-- Size of the vehicle, to be limited mostly by legal restriction of the way
|
||||
vehicle_length = 4.8, -- in meters, 4.8m is the length of large or familly car
|
||||
vehicle_weight = 3500, -- in kilograms
|
||||
|
||||
-- a list of suffixes to suppress in name change instructions. The suffixes also include common substrings of each other
|
||||
suffix_list = {
|
||||
'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW', 'North', 'South', 'West', 'East', 'Nor', 'Sou', 'We', 'Ea'
|
||||
@@ -276,6 +280,7 @@ function setup()
|
||||
["de:rural"] = 100,
|
||||
["de:motorway"] = 0,
|
||||
["dk:rural"] = 80,
|
||||
["fr:rural"] = 80,
|
||||
["gb:nsl_single"] = (60*1609)/1000,
|
||||
["gb:nsl_dual"] = (70*1609)/1000,
|
||||
["gb:motorway"] = (70*1609)/1000,
|
||||
@@ -387,6 +392,8 @@ function process_way(profile, way, result, relations)
|
||||
WayHandlers.avoid_ways,
|
||||
WayHandlers.handle_height,
|
||||
WayHandlers.handle_width,
|
||||
WayHandlers.handle_length,
|
||||
WayHandlers.handle_weight,
|
||||
|
||||
-- determine access status by checking our hierarchy of
|
||||
-- access tags, e.g: motorcar, motor_vehicle, vehicle
|
||||
|
||||
+5
-14
@@ -24,19 +24,10 @@ function setup()
|
||||
default_speed = walking_speed,
|
||||
oneway_handling = 'specific', -- respect 'oneway:foot' but not 'oneway'
|
||||
|
||||
barrier_whitelist = Set {
|
||||
'cycle_barrier',
|
||||
'bollard',
|
||||
'entrance',
|
||||
'cattle_grid',
|
||||
'border_control',
|
||||
'toll_booth',
|
||||
'sally_port',
|
||||
'gate',
|
||||
'lift_gate',
|
||||
'no',
|
||||
'kerb',
|
||||
'block'
|
||||
barrier_blacklist = Set {
|
||||
'yes',
|
||||
'wall',
|
||||
'fence'
|
||||
},
|
||||
|
||||
access_tag_whitelist = Set {
|
||||
@@ -157,7 +148,7 @@ function process_node(profile, node, result)
|
||||
local bollard = node:get_value_by_key("bollard")
|
||||
local rising_bollard = bollard and "rising" == bollard
|
||||
|
||||
if not profile.barrier_whitelist[barrier] and not rising_bollard then
|
||||
if profile.barrier_blacklist[barrier] and not rising_bollard then
|
||||
result.barrier = true
|
||||
end
|
||||
end
|
||||
|
||||
+20
-26
@@ -5,6 +5,7 @@ Measure = {}
|
||||
-- measurements conversion constants
|
||||
local inch_to_meters = 0.0254
|
||||
local feet_to_inches = 12
|
||||
local pound_to_kilograms = 0.45359237
|
||||
|
||||
--- Parse string as a height in meters.
|
||||
--- according to http://wiki.openstreetmap.org/wiki/Key:maxheight
|
||||
@@ -25,33 +26,19 @@ function Measure.parse_value_meters(value)
|
||||
end
|
||||
end
|
||||
|
||||
--- according to http://wiki.openstreetmap.org/wiki/Map_Features/Units#Explicit_specifications
|
||||
local tonns_parse_patterns = Sequence {
|
||||
"%d+",
|
||||
"%d+.%d+",
|
||||
"%d+.%d+ ?t"
|
||||
}
|
||||
|
||||
local kg_parse_patterns = Sequence {
|
||||
"%d+ ?kg"
|
||||
}
|
||||
|
||||
--- Parse weight value in kilograms
|
||||
--- Parse weight value in kilograms.
|
||||
--- according to https://wiki.openstreetmap.org/wiki/Key:maxweight
|
||||
function Measure.parse_value_kilograms(value)
|
||||
-- try to parse kilograms
|
||||
for i, templ in ipairs(kg_parse_patterns) do
|
||||
m = string.match(value, templ)
|
||||
if m then
|
||||
return tonumber(m)
|
||||
end
|
||||
end
|
||||
|
||||
-- try to parse tonns
|
||||
for i, templ in ipairs(tonns_parse_patterns) do
|
||||
m = string.match(value, templ)
|
||||
if m then
|
||||
return tonumber(m) * 1000
|
||||
local n = tonumber(value:gsub(",", "."):match("%d+%.?%d*"))
|
||||
if n then
|
||||
if string.match(value, "lbs") then
|
||||
n = n * pound_to_kilograms
|
||||
elseif string.match(value, "kg") then
|
||||
-- n = n
|
||||
else -- Default, metric tons
|
||||
n = n * 1000
|
||||
end
|
||||
return n
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,7 +70,14 @@ function Measure.get_max_width(raw_value)
|
||||
end
|
||||
end
|
||||
|
||||
--- Get maxweight of specified way in kilogramms
|
||||
--- Get maxlength of specified way in meters.
|
||||
function Measure.get_max_length(raw_value)
|
||||
if raw_value then
|
||||
return Measure.parse_value_meters(raw_value)
|
||||
end
|
||||
end
|
||||
|
||||
--- Get maxweight of specified way in kilogramms.
|
||||
function Measure.get_max_weight(raw_value)
|
||||
if raw_value then
|
||||
return Measure.parse_value_kilograms(raw_value)
|
||||
|
||||
@@ -511,6 +511,38 @@ function WayHandlers.handle_width(profile,way,result,data)
|
||||
end
|
||||
end
|
||||
|
||||
-- handle maxweight tags
|
||||
function WayHandlers.handle_weight(profile,way,result,data)
|
||||
local keys = Sequence { 'maxweight' }
|
||||
local forward, backward = Tags.get_forward_backward_by_set(way,data,keys)
|
||||
forward = Measure.get_max_weight(forward)
|
||||
backward = Measure.get_max_weight(backward)
|
||||
|
||||
if forward and forward < profile.vehicle_weight then
|
||||
result.forward_mode = mode.inaccessible
|
||||
end
|
||||
|
||||
if backward and backward < profile.vehicle_weight then
|
||||
result.backward_mode = mode.inaccessible
|
||||
end
|
||||
end
|
||||
|
||||
-- handle maxlength tags
|
||||
function WayHandlers.handle_length(profile,way,result,data)
|
||||
local keys = Sequence { 'maxlength' }
|
||||
local forward, backward = Tags.get_forward_backward_by_set(way,data,keys)
|
||||
forward = Measure.get_max_length(forward)
|
||||
backward = Measure.get_max_length(backward)
|
||||
|
||||
if forward and forward < profile.vehicle_length then
|
||||
result.forward_mode = mode.inaccessible
|
||||
end
|
||||
|
||||
if backward and backward < profile.vehicle_length then
|
||||
result.backward_mode = mode.inaccessible
|
||||
end
|
||||
end
|
||||
|
||||
-- handle oneways tags
|
||||
function WayHandlers.oneway(profile,way,result,data)
|
||||
if not profile.oneway_handling then
|
||||
|
||||
@@ -430,7 +430,6 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
|
||||
util::UnbufferedLog log;
|
||||
log << "Sorting edges by renumbered start ... ";
|
||||
TIMER_START(sort_edges_by_renumbered_start);
|
||||
std::mutex name_data_mutex;
|
||||
tbb::parallel_sort(all_edges_list.begin(),
|
||||
all_edges_list.end(),
|
||||
CmpEdgeByInternalSourceTargetAndName{
|
||||
|
||||
+9
-13
@@ -70,8 +70,8 @@ std::istream &operator>>(std::istream &in, EngineConfig::Algorithm &algorithm)
|
||||
throw util::RuntimeError(token, ErrorCode::UnknownAlgorithm, SOURCE_REF);
|
||||
return in;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
// generate boost::program_options object for the routing part
|
||||
inline unsigned generateServerProgramOptions(const int argc,
|
||||
@@ -273,10 +273,12 @@ int main(int argc, const char *argv[]) try
|
||||
|
||||
#ifndef _WIN32
|
||||
int sig = 0;
|
||||
sigset_t new_mask;
|
||||
sigset_t old_mask;
|
||||
sigfillset(&new_mask);
|
||||
pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask);
|
||||
sigset_t wait_mask;
|
||||
sigemptyset(&wait_mask);
|
||||
sigaddset(&wait_mask, SIGINT);
|
||||
sigaddset(&wait_mask, SIGQUIT);
|
||||
sigaddset(&wait_mask, SIGTERM);
|
||||
pthread_sigmask(SIG_BLOCK, &wait_mask, nullptr); // only block necessary signals
|
||||
#endif
|
||||
|
||||
auto service_handler = std::make_unique<server::ServiceHandler>(config);
|
||||
@@ -298,19 +300,13 @@ int main(int argc, const char *argv[]) try
|
||||
std::thread server_thread(std::move(server_task));
|
||||
|
||||
#ifndef _WIN32
|
||||
sigset_t wait_mask;
|
||||
pthread_sigmask(SIG_SETMASK, &old_mask, nullptr);
|
||||
sigemptyset(&wait_mask);
|
||||
sigaddset(&wait_mask, SIGINT);
|
||||
sigaddset(&wait_mask, SIGQUIT);
|
||||
sigaddset(&wait_mask, SIGTERM);
|
||||
pthread_sigmask(SIG_BLOCK, &wait_mask, nullptr);
|
||||
util::Log() << "running and waiting for requests";
|
||||
if (std::getenv("SIGNAL_PARENT_WHEN_READY"))
|
||||
{
|
||||
kill(getppid(), SIGUSR1);
|
||||
}
|
||||
sigwait(&wait_mask, &sig);
|
||||
util::Log() << "received signal " << sig;
|
||||
#else
|
||||
// Set console control handler to allow server to be stopped.
|
||||
console_ctrl_function = std::bind(&server::Server::Stop, routing_server);
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
{"key": "maxspeed", "value": "DE:rural"},
|
||||
{"key": "maxspeed", "value": "DE:motorway"},
|
||||
{"key": "maxspeed", "value": "DK:rural"},
|
||||
{"key": "maxspeed", "value": "FR:rural"},
|
||||
{"key": "maxspeed", "value": "GB:nsl_single"},
|
||||
{"key": "maxspeed", "value": "GB:nsl_dual"},
|
||||
{"key": "maxspeed", "value": "GB:motorway"},
|
||||
|
||||
Reference in New Issue
Block a user