diff --git a/Extractor/Extractor.cpp b/Extractor/Extractor.cpp index 13e82ba29..7cb7f18f5 100644 --- a/Extractor/Extractor.cpp +++ b/Extractor/Extractor.cpp @@ -182,6 +182,9 @@ int Extractor::Run(int argc, char *argv[]) tbb::concurrent_vector> resulting_ways; tbb::concurrent_vector> resulting_restrictions; + // setup restriction parser + RestrictionParser restriction_parser(scripting_environment.getLuaState()); + while (osmium::memory::Buffer buffer = reader.read()) { // create a vector of iterators into the buffer @@ -210,7 +213,6 @@ int Extractor::Run(int argc, char *argv[]) ExtractionNode result_node; ExtractionWay result_way; - // RestrictionParser restriction_parser(scripting_environment); switch (entity->type()) { @@ -222,8 +224,6 @@ int Extractor::Run(int argc, char *argv[]) boost::cref(static_cast(*entity)), boost::ref(result_node)); resulting_nodes.emplace_back(x, result_node); - // extractor_callbacks->ProcessNode(static_cast(*entity), - // result_node); break; case osmium::item_type::way: ++number_of_ways; @@ -233,12 +233,10 @@ int Extractor::Run(int argc, char *argv[]) boost::cref(static_cast(*entity)), boost::ref(result_way)); resulting_ways.emplace_back(x, result_way); - // extractor_callbacks->ProcessWay(static_cast(*entity), result_way); break; case osmium::item_type::relation: ++number_of_relations; - // resulting_restrictions.emplace_back(restriction_parser.TryParse(static_cast(*entity))); - // extractor_callbacks->ProcessRestriction(restriction_parser.TryParse(static_cast(*entity))); + resulting_restrictions.emplace_back(restriction_parser.TryParse(scripting_environment.getLuaState(), static_cast(*entity))); break; default: ++number_of_others; diff --git a/Extractor/RestrictionParser.h b/Extractor/RestrictionParser.h index fcf98dfc5..1cfe2aca5 100644 --- a/Extractor/RestrictionParser.h +++ b/Extractor/RestrictionParser.h @@ -51,7 +51,7 @@ class RestrictionParser private: void ReadUseRestrictionsSetting(lua_State *lua_state); void ReadRestrictionExceptions(lua_State *lua_state); - bool ShouldIgnoreRestriction(lua_State *lua_state, const std::string &except_tag_string) const; + bool ShouldIgnoreRestriction(const std::string &except_tag_string) const; // lua_State *lua_state; std::vector restriction_exceptions;