Expose component size variable as command-line option (this allows testing of big/small components in cucumber tests).

Add ability to pass extra parameters to  during tests.
Limit distance table search so that it doesn't return any big components if they're beyond max_distance.
This commit is contained in:
Daniel Patterson
2015-12-01 17:46:29 -08:00
committed by Patrick Niklaus
parent f3f153cb38
commit 4ddbd2efb6
7 changed files with 43 additions and 3 deletions
+1 -1
View File
@@ -436,7 +436,7 @@ void extractor::FindComponents(unsigned max_edge_id,
component_search.get_component_id(node.reverse_edge_based_node_id));
const unsigned component_size = component_search.get_component_size(forward_component);
node.component.is_tiny = component_size < 1000;
node.component.is_tiny = component_size < config.small_component_size;
node.component.id = 1 + forward_component;
}
}
+5 -1
View File
@@ -64,7 +64,11 @@ ExtractorOptions::ParseArguments(int argc, char *argv[], ExtractorConfig &extrac
"Number of threads to use")(
"generate-edge-lookup",boost::program_options::value<bool>(
&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");
"Generate a lookup table for internal edge-expanded-edge IDs to OSM node pairs")(
"small-component-size",
boost::program_options::value<unsigned int>(&extractor_config.small_component_size)
->default_value(1000),
"Number of nodes required before a strongly-connected-componennt is considered big (affects nearest neighbor snapping)");
#ifdef DEBUG_GEOMETRY
config_options.add_options()("debug-turns",
+1
View File
@@ -58,6 +58,7 @@ struct ExtractorConfig
std::string rtree_leafs_output_path;
unsigned requested_num_threads;
unsigned small_component_size;
bool generate_edge_lookup;
std::string edge_penalty_path;