Skip to content

Commit

Permalink
Refactor edge expansion into extract phase. New temporary file is gen…
Browse files Browse the repository at this point in the history
…erated - '.osrm.ebg' which is used by
  • Loading branch information
danpat committed Oct 6, 2015
1 parent cdc4fb4 commit e45656e
Show file tree
Hide file tree
Showing 20 changed files with 459 additions and 352 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -51,7 +51,7 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/util/version.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/util/version.hpp
)
file(GLOB ExtractorGlob extractor/*.cpp)
file(GLOB ExtractorGlob extractor/*.cpp data_structures/hilbert_value.cpp)
file(GLOB ImporterGlob data_structures/import_edge.cpp data_structures/external_memory_node.cpp data_structures/raster_source.cpp)
add_library(IMPORT OBJECT ${ImporterGlob})
add_library(LOGGER OBJECT util/simple_logger.cpp)
Expand All @@ -62,7 +62,7 @@ add_library(MERCATOR OBJECT util/mercator.cpp)
add_library(ANGLE OBJECT util/compute_angle.cpp)

set(ExtractorSources extract.cpp ${ExtractorGlob})
add_executable(osrm-extract ${ExtractorSources} $<TARGET_OBJECTS:COORDINATE> $<TARGET_OBJECTS:FINGERPRINT> $<TARGET_OBJECTS:IMPORT> $<TARGET_OBJECTS:LOGGER> $<TARGET_OBJECTS:EXCEPTION> $<TARGET_OBJECTS:MERCATOR>)
add_executable(osrm-extract ${ExtractorSources} $<TARGET_OBJECTS:COORDINATE> $<TARGET_OBJECTS:FINGERPRINT> $<TARGET_OBJECTS:IMPORT> $<TARGET_OBJECTS:LOGGER> $<TARGET_OBJECTS:EXCEPTION> $<TARGET_OBJECTS:MERCATOR> $<TARGET_OBJECTS:COMPRESSEDEDGE> $<TARGET_OBJECTS:GRAPHCOMPRESSOR> $<TARGET_OBJECTS:RESTRICTION> $<TARGET_OBJECTS:ANGLE>)

add_library(RESTRICTION OBJECT data_structures/restriction_map.cpp)
add_library(COMPRESSEDEDGE OBJECT data_structures/compressed_edge_container.cpp)
Expand Down
2 changes: 1 addition & 1 deletion algorithms/graph_compressor.hpp
Expand Up @@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "../typedefs.h"

#include "../contractor/speed_profile.hpp"
#include "../extractor/speed_profile.hpp"
#include "../data_structures/node_based_graph.hpp"

#include <memory>
Expand Down
14 changes: 1 addition & 13 deletions contractor/contractor_options.cpp
Expand Up @@ -48,9 +48,6 @@ ContractorOptions::ParseArguments(int argc, char *argv[], ContractorConfig &cont
// declare a group of options that will be allowed both on command line and in config file
boost::program_options::options_description config_options("Configuration");
config_options.add_options()(
"restrictions,r",
boost::program_options::value<boost::filesystem::path>(&contractor_config.restrictions_path),
"Restrictions file in .osrm.restrictions format")(
"profile,p", boost::program_options::value<boost::filesystem::path>(&contractor_config.profile_path)
->default_value("profile.lua"),
"Path to LUA routing profile")(
Expand Down Expand Up @@ -114,11 +111,6 @@ ContractorOptions::ParseArguments(int argc, char *argv[], ContractorConfig &cont

boost::program_options::notify(option_variables);

if (!option_variables.count("restrictions"))
{
contractor_config.restrictions_path = contractor_config.osrm_input_path.string() + ".restrictions";
}

if (!option_variables.count("input"))
{
SimpleLogger().Write() << "\n" << visible_options;
Expand All @@ -130,11 +122,7 @@ ContractorOptions::ParseArguments(int argc, char *argv[], ContractorConfig &cont

void ContractorOptions::GenerateOutputFilesNames(ContractorConfig &contractor_config)
{
contractor_config.node_output_path = contractor_config.osrm_input_path.string() + ".nodes";
contractor_config.core_output_path = contractor_config.osrm_input_path.string() + ".core";
contractor_config.edge_output_path = contractor_config.osrm_input_path.string() + ".edges";
contractor_config.geometry_output_path = contractor_config.osrm_input_path.string() + ".geometry";
contractor_config.graph_output_path = contractor_config.osrm_input_path.string() + ".hsgr";
contractor_config.rtree_nodes_output_path = contractor_config.osrm_input_path.string() + ".ramIndex";
contractor_config.rtree_leafs_output_path = contractor_config.osrm_input_path.string() + ".fileIndex";
contractor_config.edge_based_graph_path = contractor_config.osrm_input_path.string() + ".ebg";
}
7 changes: 1 addition & 6 deletions contractor/contractor_options.hpp
Expand Up @@ -45,16 +45,11 @@ struct ContractorConfig

boost::filesystem::path config_file_path;
boost::filesystem::path osrm_input_path;
boost::filesystem::path restrictions_path;
boost::filesystem::path profile_path;

std::string node_output_path;
std::string core_output_path;
std::string edge_output_path;
std::string geometry_output_path;
std::string graph_output_path;
std::string rtree_nodes_output_path;
std::string rtree_leafs_output_path;
std::string edge_based_graph_path;

unsigned requested_num_threads;

Expand Down

0 comments on commit e45656e

Please sign in to comment.