Reworks Restriction Whitelist / Blacklist, resolves #2833
Takes a stricter aproach for whitelisting / blacklisting restrictions: - uses `restriction=` - uses more specific `restriction:<type>=` - uses `except=<type>` to invert Where `type` is the type of transportation to restrict, e.g. `motorcar`. https://github.com/Project-OSRM/osrm-backend/issues/2833
This commit is contained in:
committed by
Moritz Kobitzsch
parent
e7b2f85a20
commit
bbbbacb073
@@ -29,7 +29,7 @@ class ScriptingEnvironment;
|
||||
*
|
||||
* While this class does not directly invoke any lua code _per relation_ it does
|
||||
* load configuration values from the profile, that are saved in variables.
|
||||
* Namely ```use_turn_restrictions``` and ```get_exceptions```.
|
||||
* Namely ```use_turn_restrictions``` and ```get_restrictions```.
|
||||
*
|
||||
* The restriction is represented by the osm id of the from way, the osm id of the
|
||||
* to way and the osm id of the via node. This representation must be post-processed
|
||||
@@ -47,7 +47,7 @@ class RestrictionParser
|
||||
private:
|
||||
bool ShouldIgnoreRestriction(const std::string &except_tag_string) const;
|
||||
|
||||
std::vector<std::string> restriction_exceptions;
|
||||
std::vector<std::string> restrictions;
|
||||
bool use_turn_restrictions;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class ScriptingEnvironment
|
||||
virtual const ProfileProperties &GetProfileProperties() = 0;
|
||||
|
||||
virtual std::vector<std::string> GetNameSuffixList() = 0;
|
||||
virtual std::vector<std::string> GetExceptions() = 0;
|
||||
virtual std::vector<std::string> GetRestrictions() = 0;
|
||||
virtual void SetupSources() = 0;
|
||||
virtual int32_t GetTurnPenalty(double angle) = 0;
|
||||
virtual void ProcessSegment(const osrm::util::Coordinate &source,
|
||||
|
||||
@@ -53,7 +53,7 @@ class LuaScriptingEnvironment final : public ScriptingEnvironment
|
||||
LuaScriptingContext &GetLuaContext();
|
||||
|
||||
std::vector<std::string> GetNameSuffixList() override;
|
||||
std::vector<std::string> GetExceptions() override;
|
||||
std::vector<std::string> GetRestrictions() override;
|
||||
void SetupSources() override;
|
||||
int32_t GetTurnPenalty(double angle) override;
|
||||
void ProcessSegment(const osrm::util::Coordinate &source,
|
||||
|
||||
Reference in New Issue
Block a user