Adds .properties file to osrm-extract ouput

This file contains global properties set by the lua
profile, such as enabling uturns at vias and penalties.
This file will be consumed by the server.
This commit is contained in:
Patrick Niklaus
2016-03-21 22:42:47 +01:00
parent e10e8910f3
commit 71c336d9dd
18 changed files with 253 additions and 250 deletions
+3 -22
View File
@@ -1,5 +1,5 @@
#include "extractor/restriction_parser.hpp"
#include "extractor/extraction_way.hpp"
#include "extractor/profile_properties.hpp"
#include "extractor/external_memory_node.hpp"
#include "util/lua_util.hpp"
@@ -33,34 +33,15 @@ int luaErrorCallback(lua_State *lua_state)
}
}
RestrictionParser::RestrictionParser(lua_State *lua_state) : use_turn_restrictions(true)
RestrictionParser::RestrictionParser(lua_State *lua_state, const ProfileProperties &properties)
: use_turn_restrictions(properties.use_turn_restrictions)
{
ReadUseRestrictionsSetting(lua_state);
if (use_turn_restrictions)
{
ReadRestrictionExceptions(lua_state);
}
}
void RestrictionParser::ReadUseRestrictionsSetting(lua_State *lua_state)
{
if (0 == luaL_dostring(lua_state, "return use_turn_restrictions\n") &&
lua_isboolean(lua_state, -1))
{
use_turn_restrictions = lua_toboolean(lua_state, -1);
}
if (use_turn_restrictions)
{
util::SimpleLogger().Write() << "Using turn restrictions";
}
else
{
util::SimpleLogger().Write() << "Ignoring turn restrictions";
}
}
void RestrictionParser::ReadRestrictionExceptions(lua_State *lua_state)
{
if (util::lua_function_exists(lua_state, "get_exceptions"))