diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b0d512a..aec596ce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances - Files - .osrm.datasource_index file was removed. Data is now part of .osrm.geometries. + - .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now. + - `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore # 5.6.3 - Changes from 5.6.0 diff --git a/features/options/contract/edge-weight-updates-over-factor.feature b/features/options/contract/edge-weight-updates-over-factor.feature index 85e5fa8fe..6d7c313bc 100644 --- a/features/options/contract/edge-weight-updates-over-factor.feature +++ b/features/options/contract/edge-weight-updates-over-factor.feature @@ -22,8 +22,8 @@ Feature: osrm-contract command line option: edge-weight-updates-over-factor Scenario: Logging weight with updates over factor of 2, long segment When I run "osrm-extract --profile {profile_file} {osm_file} --generate-edge-lookup" When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}" - And stderr should contain "weight updates" - And stderr should contain "New speed: 100 kph" + And stderr should contain "Segment: 1,2" + And stderr should contain "Segment: 1,3" And I route I should get | from | to | route | speed | | a | b | ab,ab | 100 km/h | diff --git a/features/options/contract/invalid.feature b/features/options/contract/invalid.feature deleted file mode 100644 index 15da09596..000000000 --- a/features/options/contract/invalid.feature +++ /dev/null @@ -1,28 +0,0 @@ -@prepare @options @invalid -Feature: osrm-contract command line options: invalid options - - Background: - Given the profile "testbot" - And the node map - """ - a b - """ - And the ways - | nodes | - | ab | - And the data has been extracted - - Scenario: osrm-contract - Non-existing option - When I try to run "osrm-contract --fly-me-to-the-moon" - Then stdout should be empty - And stderr should contain "option" - And stderr should contain "fly-me-to-the-moon" - And it should exit with an error - - # This tests the error messages when you try to use --segment-speed-file, - # but osrm-extract has not been run with --generate-edge-lookup - Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract - When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}" - Then stderr should contain "Error while trying to mmap" - Then stderr should contain ".osrm.turn_penalties_index" - And it should exit with an error diff --git a/features/options/extract/help.feature b/features/options/extract/help.feature index 9cc8f30fb..072c33f57 100644 --- a/features/options/extract/help.feature +++ b/features/options/extract/help.feature @@ -14,7 +14,6 @@ Feature: osrm-extract command line options: help And stdout should contain "Configuration:" And stdout should contain "--profile" And stdout should contain "--threads" - And stdout should contain "--generate-edge-lookup" And stdout should contain "--small-component-size" And it should exit successfully @@ -28,7 +27,6 @@ Feature: osrm-extract command line options: help And stdout should contain "Configuration:" And stdout should contain "--profile" And stdout should contain "--threads" - And stdout should contain "--generate-edge-lookup" And stdout should contain "--small-component-size" And it should exit successfully @@ -42,6 +40,5 @@ Feature: osrm-extract command line options: help And stdout should contain "Configuration:" And stdout should contain "--profile" And stdout should contain "--threads" - And stdout should contain "--generate-edge-lookup" And stdout should contain "--small-component-size" And it should exit successfully diff --git a/include/extractor/edge_based_graph_factory.hpp b/include/extractor/edge_based_graph_factory.hpp index f8cd7dd90..db79b38ad 100644 --- a/include/extractor/edge_based_graph_factory.hpp +++ b/include/extractor/edge_based_graph_factory.hpp @@ -84,8 +84,7 @@ class EdgeBasedGraphFactory const std::string &turn_weight_penalties_filename, const std::string &turn_duration_penalties_filename, const std::string &turn_penalties_index_filename, - const std::string &cnbg_ebg_mapping_path, - const bool generate_edge_lookup); + const std::string &cnbg_ebg_mapping_path); // The following get access functions destroy the content in the factory void GetEdgeBasedEdges(util::DeallocatingVector &edges); @@ -152,8 +151,7 @@ class EdgeBasedGraphFactory const std::string &turn_lane_data_filename, const std::string &turn_weight_penalties_filename, const std::string &turn_duration_penalties_filename, - const std::string &turn_penalties_index_filename, - const bool generate_edge_lookup); + const std::string &turn_penalties_index_filename); // Mapping betweenn the node based graph u,v nodes and the edge based graph head,tail edge ids. // Required in the osrm-partition tool to translate from a nbg partition to a ebg partition. diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 71e29db56..04f742f30 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -199,8 +199,7 @@ void EdgeBasedGraphFactory::Run(ScriptingEnvironment &scripting_environment, const std::string &turn_weight_penalties_filename, const std::string &turn_duration_penalties_filename, const std::string &turn_penalties_index_filename, - const std::string &cnbg_ebg_mapping_path, - const bool generate_edge_lookup) + const std::string &cnbg_ebg_mapping_path) { TIMER_START(renumber); m_max_edge_id = RenumberEdges() - 1; @@ -217,8 +216,7 @@ void EdgeBasedGraphFactory::Run(ScriptingEnvironment &scripting_environment, turn_lane_data_filename, turn_weight_penalties_filename, turn_duration_penalties_filename, - turn_penalties_index_filename, - generate_edge_lookup); + turn_penalties_index_filename); TIMER_STOP(generate_edges); @@ -330,8 +328,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( const std::string &turn_lane_data_filename, const std::string &turn_weight_penalties_filename, const std::string &turn_duration_penalties_filename, - const std::string &turn_penalties_index_filename, - const bool generate_edge_lookup) + const std::string &turn_penalties_index_filename) { util::Log() << "Generating edge-expanded edges "; @@ -584,27 +581,24 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( // look // up the node // immediately preceding the turn from the compressed edge container. - if (generate_edge_lookup) - { - const bool isTrivial = m_compressed_edge_container.IsTrivial(incoming_edge); + const bool isTrivial = m_compressed_edge_container.IsTrivial(incoming_edge); - const auto &from_node = - isTrivial - ? m_node_info_list[node_along_road_entering] - : m_node_info_list[m_compressed_edge_container.GetLastEdgeSourceID( - incoming_edge)]; - const auto &via_node = - m_node_info_list[m_compressed_edge_container.GetLastEdgeTargetID( - incoming_edge)]; - const auto &to_node = - m_node_info_list[m_compressed_edge_container.GetFirstEdgeTargetID( - turn.eid)]; + const auto &from_node = + isTrivial + ? m_node_info_list[node_along_road_entering] + : m_node_info_list[m_compressed_edge_container.GetLastEdgeSourceID( + incoming_edge)]; + const auto &via_node = + m_node_info_list[m_compressed_edge_container.GetLastEdgeTargetID( + incoming_edge)]; + const auto &to_node = + m_node_info_list[m_compressed_edge_container.GetFirstEdgeTargetID( + turn.eid)]; - lookup::TurnIndexBlock turn_index_block = { - from_node.node_id, via_node.node_id, to_node.node_id}; + lookup::TurnIndexBlock turn_index_block = { + from_node.node_id, via_node.node_id, to_node.node_id}; - turn_penalties_index_file.WriteOne(turn_index_block); - } + turn_penalties_index_file.WriteOne(turn_index_block); } } } diff --git a/src/extractor/extractor.cpp b/src/extractor/extractor.cpp index 296b13ba6..02205c66e 100644 --- a/src/extractor/extractor.cpp +++ b/src/extractor/extractor.cpp @@ -486,8 +486,7 @@ Extractor::BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment, config.turn_weight_penalties_path, config.turn_duration_penalties_path, config.turn_penalties_index_path, - config.cnbg_ebg_graph_mapping_output_path, - config.generate_edge_lookup); + config.cnbg_ebg_graph_mapping_output_path); // The osrm-partition tool requires the compressed node based graph with an embedding. // diff --git a/src/tools/extract.cpp b/src/tools/extract.cpp index 97bf16147..a24d32dd2 100644 --- a/src/tools/extract.cpp +++ b/src/tools/extract.cpp @@ -41,11 +41,6 @@ return_code parseArguments(int argc, char *argv[], extractor::ExtractorConfig &e boost::program_options::value(&extractor_config.requested_num_threads) ->default_value(tbb::task_scheduler_init::default_num_threads()), "Number of threads to use")( - "generate-edge-lookup", - boost::program_options::value(&extractor_config.generate_edge_lookup) - ->implicit_value(true) - ->default_value(false), - "Generate a lookup table for internal edge-expanded-edge IDs to OSM node pairs")( "small-component-size", boost::program_options::value(&extractor_config.small_component_size) ->default_value(1000), @@ -57,13 +52,17 @@ return_code parseArguments(int argc, char *argv[], extractor::ExtractorConfig &e ->default_value(false), "Use metada during osm parsing (This can affect the extraction performance)."); + bool dummy; // hidden options, will be allowed on command line, but will not be // shown to the user boost::program_options::options_description hidden_options("Hidden options"); hidden_options.add_options()( "input,i", boost::program_options::value(&extractor_config.input_path), - "Input file in .osm, .osm.bz2 or .osm.pbf format"); + "Input file in .osm, .osm.bz2 or .osm.pbf format")( + "generate-edge-lookup", + boost::program_options::value(&dummy)->implicit_value(true)->default_value(false), + "Not used anymore"); // positional option boost::program_options::positional_options_description positional_options;