fix loading of ini files
This commit is contained in:
parent
190def17e5
commit
027a4081a2
@ -230,79 +230,66 @@ inline bool GenerateServerProgramOptions(
|
|||||||
boost::program_options::notify(option_variables);
|
boost::program_options::notify(option_variables);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !use_shared_memory ) {
|
if( !use_shared_memory && option_variables.count("base") ) {
|
||||||
|
std::string base_string = paths["base"].string();
|
||||||
path_iterator = paths.find("hsgrdata");
|
path_iterator = paths.find("hsgrdata");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("hsgrdata (or base) must be specified");
|
paths["hsgrdata"] = base_string + ".hsgr";
|
||||||
}
|
}
|
||||||
paths["hsgrdata"] = std::string( paths["base"].string()) + ".hsgr";
|
|
||||||
|
|
||||||
path_iterator = paths.find("nodesdata");
|
path_iterator = paths.find("nodesdata");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("nodesdata (or base) must be specified");
|
paths["nodesdata"] = base_string + ".nodes";
|
||||||
}
|
}
|
||||||
paths["nodesdata"] = std::string( paths["base"].string()) + ".nodes";
|
|
||||||
|
|
||||||
path_iterator = paths.find("edgesdata");
|
path_iterator = paths.find("edgesdata");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("edgesdata (or base) must be specified");
|
paths["edgesdata"] = base_string + ".edges";
|
||||||
}
|
}
|
||||||
paths["edgesdata"] = std::string( paths["base"].string()) + ".edges";
|
|
||||||
|
|
||||||
path_iterator = paths.find("ramindex");
|
path_iterator = paths.find("ramindex");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("ramindex (or base) must be specified");
|
paths["ramindex"] = base_string + ".ramIndex";
|
||||||
}
|
}
|
||||||
paths["ramindex"] = std::string( paths["base"].string()) + ".ramIndex";
|
|
||||||
|
|
||||||
path_iterator = paths.find("fileindex");
|
path_iterator = paths.find("fileindex");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("fileindex (or base) must be specified");
|
paths["fileindex"] = base_string + ".fileIndex";
|
||||||
}
|
}
|
||||||
paths["fileindex"] = std::string( paths["base"].string()) + ".fileIndex";
|
|
||||||
|
|
||||||
path_iterator = paths.find("namesdata");
|
path_iterator = paths.find("namesdata");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("namesdata (or base) must be specified");
|
paths["namesdata"] = base_string + ".names";
|
||||||
}
|
}
|
||||||
paths["namesdata"] = std::string( paths["base"].string()) + ".names";
|
|
||||||
|
|
||||||
path_iterator = paths.find("timestamp");
|
path_iterator = paths.find("timestamp");
|
||||||
if(
|
if(
|
||||||
path_iterator == paths.end() ||
|
path_iterator != paths.end() &&
|
||||||
boost::filesystem::is_regular_file(path_iterator->second) ||
|
!boost::filesystem::is_regular_file(path_iterator->second)
|
||||||
!option_variables.count("base")
|
|
||||||
) {
|
) {
|
||||||
throw OSRMException("timestamp (or base) must be specified");
|
paths["timestamp"] = (paths["base"].string() + ".timestamp");
|
||||||
}
|
}
|
||||||
paths["timestamp"] = (paths["base"].string() + ".timestamp");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(1 > requested_num_threads) {
|
|
||||||
|
if( 1 > requested_num_threads ) {
|
||||||
throw OSRMException("Number of threads must be a positive number");
|
throw OSRMException("Number of threads must be a positive number");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user