From fccb1aad324cac2f9422c13c6063a55d3c5d05ee Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Tue, 19 Aug 2014 16:08:38 +0200 Subject: [PATCH] remove type attribute --- Extractor/ExtractionContainers.cpp | 1 - Extractor/ExtractionWay.h | 2 -- Extractor/ExtractorCallbacks.cpp | 2 -- Extractor/InternalExtractorEdge.h | 10 ++++------ Extractor/ScriptingEnvironment.cpp | 1 - Util/GraphLoader.h | 2 -- profiles/bicycle.lua | 3 +-- profiles/car.lua | 3 +-- profiles/foot.lua | 3 +-- profiles/testbot.lua | 3 +-- 10 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Extractor/ExtractionContainers.cpp b/Extractor/ExtractionContainers.cpp index 9a88a56ac..3c7c97465 100644 --- a/Extractor/ExtractionContainers.cpp +++ b/Extractor/ExtractionContainers.cpp @@ -371,7 +371,6 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name, } file_out_stream.write((char *)&integer_weight, sizeof(int)); - file_out_stream.write((char *)&edge_iterator->type, sizeof(short)); file_out_stream.write((char *)&edge_iterator->name_id, sizeof(unsigned)); file_out_stream.write((char *)&edge_iterator->is_roundabout, sizeof(bool)); file_out_stream.write((char *)&edge_iterator->is_in_tiny_cc, sizeof(bool)); diff --git a/Extractor/ExtractionWay.h b/Extractor/ExtractionWay.h index 703e22e46..43ba17503 100644 --- a/Extractor/ExtractionWay.h +++ b/Extractor/ExtractionWay.h @@ -48,7 +48,6 @@ struct ExtractionWay forward_speed = -1; backward_speed = -1; duration = -1; - type = -1; access = true; roundabout = false; isAccessRestricted = false; @@ -113,7 +112,6 @@ struct ExtractionWay double backward_speed; double duration; std::string name; - short type; bool access; bool roundabout; bool isAccessRestricted; diff --git a/Extractor/ExtractorCallbacks.cpp b/Extractor/ExtractorCallbacks.cpp index 393d5b90b..33268a346 100644 --- a/Extractor/ExtractorCallbacks.cpp +++ b/Extractor/ExtractorCallbacks.cpp @@ -125,7 +125,6 @@ void ExtractorCallbacks::ProcessWay(ExtractionWay &parsed_way) external_memory.all_edges_list.push_back(InternalExtractorEdge( parsed_way.path[n], parsed_way.path[n + 1], - parsed_way.type, ((split_edge || TRAVEL_MODE_INACCESSIBLE == parsed_way.backward_travel_mode) ? ExtractionWay::oneway : ExtractionWay::bidirectional), parsed_way.forward_speed, @@ -157,7 +156,6 @@ void ExtractorCallbacks::ProcessWay(ExtractionWay &parsed_way) external_memory.all_edges_list.push_back( InternalExtractorEdge(parsed_way.path[n], parsed_way.path[n + 1], - parsed_way.type, ExtractionWay::oneway, parsed_way.backward_speed, parsed_way.nameID, diff --git a/Extractor/InternalExtractorEdge.h b/Extractor/InternalExtractorEdge.h index 5c03efd4d..b1dde2508 100644 --- a/Extractor/InternalExtractorEdge.h +++ b/Extractor/InternalExtractorEdge.h @@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. struct InternalExtractorEdge { InternalExtractorEdge() - : start(0), target(0), type(0), direction(0), speed(0), name_id(0), is_roundabout(false), + : start(0), target(0), direction(0), speed(0), name_id(0), is_roundabout(false), is_in_tiny_cc(false), is_duration_set(false), is_access_restricted(false), travel_mode(TRAVEL_MODE_INACCESSIBLE), is_split(false) { @@ -45,7 +45,6 @@ struct InternalExtractorEdge explicit InternalExtractorEdge(NodeID start, NodeID target, - short type, short direction, double speed, unsigned name_id, @@ -55,7 +54,7 @@ struct InternalExtractorEdge bool is_access_restricted, TravelMode travel_mode, bool is_split) - : start(start), target(target), type(type), direction(direction), speed(speed), + : start(start), target(target), direction(direction), speed(speed), name_id(name_id), is_roundabout(is_roundabout), is_in_tiny_cc(is_in_tiny_cc), is_duration_set(is_duration_set), is_access_restricted(is_access_restricted), travel_mode(travel_mode), is_split(is_split) @@ -66,17 +65,16 @@ struct InternalExtractorEdge // necessary static util functions for stxxl's sorting static InternalExtractorEdge min_value() { - return InternalExtractorEdge(0, 0, 0, 0, 0, 0, false, false, false, false, TRAVEL_MODE_INACCESSIBLE, false); + return InternalExtractorEdge(0, 0, 0, 0, 0, false, false, false, false, TRAVEL_MODE_INACCESSIBLE, false); } static InternalExtractorEdge max_value() { return InternalExtractorEdge( - SPECIAL_NODEID, SPECIAL_NODEID, 0, 0, 0, 0, false, false, false, false, TRAVEL_MODE_INACCESSIBLE, false); + SPECIAL_NODEID, SPECIAL_NODEID, 0, 0, 0, false, false, false, false, TRAVEL_MODE_INACCESSIBLE, false); } NodeID start; NodeID target; - short type; short direction; double speed; unsigned name_id; diff --git a/Extractor/ScriptingEnvironment.cpp b/Extractor/ScriptingEnvironment.cpp index ed2075f98..b9fd608e1 100644 --- a/Extractor/ScriptingEnvironment.cpp +++ b/Extractor/ScriptingEnvironment.cpp @@ -79,7 +79,6 @@ void ScriptingEnvironment::initLuaState(lua_State* lua_state) .def_readwrite("forward_speed", &ExtractionWay::forward_speed) .def_readwrite("backward_speed", &ExtractionWay::backward_speed) .def_readwrite("duration", &ExtractionWay::duration) - .def_readwrite("type", &ExtractionWay::type) .def_readwrite("access", &ExtractionWay::access) .def_readwrite("roundabout", &ExtractionWay::roundabout) .def_readwrite("is_access_restricted", &ExtractionWay::isAccessRestricted) diff --git a/Util/GraphLoader.h b/Util/GraphLoader.h index 6a61676cb..bea08c0ea 100644 --- a/Util/GraphLoader.h +++ b/Util/GraphLoader.h @@ -138,7 +138,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, input_stream.read((char *)&length, sizeof(int)); input_stream.read((char *)&dir, sizeof(short)); input_stream.read((char *)&weight, sizeof(int)); - input_stream.read((char *)&type, sizeof(short)); input_stream.read((char *)&nameID, sizeof(unsigned)); input_stream.read((char *)&is_roundabout, sizeof(bool)); input_stream.read((char *)&ignore_in_grid, sizeof(bool)); @@ -316,7 +315,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, input_stream.read((char *)&length, sizeof(int)); input_stream.read((char *)&dir, sizeof(short)); input_stream.read((char *)&weight, sizeof(int)); - input_stream.read((char *)&type, sizeof(short)); input_stream.read((char *)&nameID, sizeof(unsigned)); input_stream.read((char *)&is_roundabout, sizeof(bool)); input_stream.read((char *)&ignore_in_grid, sizeof(bool)); diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 09a234b5c..89513b033 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -373,8 +373,7 @@ function way_function (way) -- maxspeed MaxSpeed.limit( way, maxspeed, maxspeed_forward, maxspeed_backward ) - way.type = 1 - return 1 + return true end function turn_function (angle) diff --git a/profiles/car.lua b/profiles/car.lua index 990c38049..eead81b89 100755 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -274,14 +274,13 @@ function way_function (way) if ignore_in_grid[highway] then way.ignore_in_grid = true end - way.type = 1 -- scale speeds to get better avg driving times way.forward_speed = way.forward_speed * speed_reduction if maxspeed_backward > 0 then way.backward_speed = way.backward_speed*speed_reduction end - return + return true end -- These are wrappers to parse vectors of nodes and ways and thus to speed up any tracing JIT diff --git a/profiles/foot.lua b/profiles/foot.lua index effd54e99..130d297a6 100644 --- a/profiles/foot.lua +++ b/profiles/foot.lua @@ -203,6 +203,5 @@ function way_function (way) end end - way.type = 1 - return 1 + return true end diff --git a/profiles/testbot.lua b/profiles/testbot.lua index 640c81651..a03ea41e3 100644 --- a/profiles/testbot.lua +++ b/profiles/testbot.lua @@ -119,6 +119,5 @@ function way_function (way) way.roundabout = true end - way.type = 1 - return 1 + return true end