fix geometry load on shared memory

This commit is contained in:
Dennis Luxen 2014-04-29 09:50:29 +02:00
parent e44ebe0743
commit d6962f3a09
2 changed files with 30 additions and 28 deletions

View File

@ -105,11 +105,11 @@ inline bool GenerateDataStoreOptions(const int argc, const char * argv[], Server
boost::program_options::value<boost::filesystem::path>(&paths["edgesdata"]), boost::program_options::value<boost::filesystem::path>(&paths["edgesdata"]),
".edges file" ".edges file"
) )
// ( (
// "geometry", "geometry",
// boost::program_options::value<boost::filesystem::path>(&paths["geometries"]), boost::program_options::value<boost::filesystem::path>(&paths["geometry"]),
// ".geometry file" ".geometry file"
// ) )
( (
"ramindex", "ramindex",
boost::program_options::value<boost::filesystem::path>(&paths["ramindex"]), boost::program_options::value<boost::filesystem::path>(&paths["ramindex"]),
@ -180,13 +180,13 @@ inline bool GenerateDataStoreOptions(const int argc, const char * argv[], Server
boost::program_options::notify(option_variables); boost::program_options::notify(option_variables);
const bool parameter_present = const bool parameter_present =
(paths.find("hsgrdata") != paths.end() && !paths.find("hsgrdata")->second.string().empty() ) || (paths.find("hsgrdata") != paths.end() && !paths.find("hsgrdata" )->second.string().empty()) ||
(paths.find("nodesdata") != paths.end() && !paths.find("nodesdata")->second.string().empty()) || (paths.find("nodesdata") != paths.end() && !paths.find("nodesdata")->second.string().empty()) ||
(paths.find("edgesdata") != paths.end() && !paths.find("edgesdata")->second.string().empty()) || (paths.find("edgesdata") != paths.end() && !paths.find("edgesdata")->second.string().empty()) ||
// (paths.find("geometry") != paths.end() && !paths.find("geometry")->second.string().empty())) || (paths.find("geometry") != paths.end() && !paths.find("geometry" )->second.string().empty()) ||
(paths.find("ramindex") != paths.end() && !paths.find("ramindex")->second.string().empty()) || (paths.find("ramindex") != paths.end() && !paths.find("ramindex" )->second.string().empty()) ||
(paths.find("fileindex") != paths.end() && !paths.find("fileindex")->second.string().empty()) || (paths.find("fileindex") != paths.end() && !paths.find("fileindex")->second.string().empty()) ||
(paths.find("timestamp") != paths.end() && !paths.find("timestamp")->second.string().empty()) ; (paths.find("timestamp") != paths.end() && !paths.find("timestamp")->second.string().empty());
if (parameter_present) if (parameter_present)
{ {
@ -244,11 +244,11 @@ inline bool GenerateDataStoreOptions(const int argc, const char * argv[], Server
path_iterator->second = base_string + ".edges"; path_iterator->second = base_string + ".edges";
} }
// path_iterator = paths.find("geometries"); path_iterator = paths.find("geometry");
// if (path_iterator != paths.end()) if (path_iterator != paths.end())
// { {
// path_iterator->second = base_string + ".geometry"; path_iterator->second = base_string + ".geometry";
// } }
path_iterator = paths.find("ramindex"); path_iterator = paths.find("ramindex");
if (path_iterator != paths.end()) if (path_iterator != paths.end())
@ -296,12 +296,12 @@ inline bool GenerateDataStoreOptions(const int argc, const char * argv[], Server
} }
AssertPathExists(path_iterator->second); AssertPathExists(path_iterator->second);
// path_iterator = paths.find("geometries"); path_iterator = paths.find("geometry");
// if (path_iterator == paths.end() || path_iterator->second.string().empty()) if (path_iterator == paths.end() || path_iterator->second.string().empty())
// { {
// path_iterator->second = base_string + ".geometry"; throw OSRMException(".geometry file must be specified");
// } }
// AssertPathExists(path_iterator->second); AssertPathExists(path_iterator->second);
path_iterator = paths.find("ramindex"); path_iterator = paths.find("ramindex");
if (path_iterator == paths.end() || path_iterator->second.string().empty()) if (path_iterator == paths.end() || path_iterator->second.string().empty())

View File

@ -92,22 +92,25 @@ int main( const int argc, const char * argv[] )
return 0; return 0;
} }
if( server_paths.find("hsgrdata") == server_paths.end() ) { if( server_paths.find("hsgrdata") == server_paths.end() ) {
throw OSRMException("no hsgr file given in ini file"); throw OSRMException("no hsgr file found");
} }
if( server_paths.find("ramindex") == server_paths.end() ) { if( server_paths.find("ramindex") == server_paths.end() ) {
throw OSRMException("no ram index file given in ini file"); throw OSRMException("no ram index file found");
} }
if( server_paths.find("fileindex") == server_paths.end() ) { if( server_paths.find("fileindex") == server_paths.end() ) {
throw OSRMException("no leaf index file given in ini file"); throw OSRMException("no leaf index file found");
} }
if( server_paths.find("nodesdata") == server_paths.end() ) { if( server_paths.find("nodesdata") == server_paths.end() ) {
throw OSRMException("no nodes file given in ini file"); throw OSRMException("no nodes file found");
} }
if( server_paths.find("edgesdata") == server_paths.end() ) { if( server_paths.find("edgesdata") == server_paths.end() ) {
throw OSRMException("no edges file given in ini file"); throw OSRMException("no edges file found");
} }
if( server_paths.find("namesdata") == server_paths.end() ) { if( server_paths.find("namesdata") == server_paths.end() ) {
throw OSRMException("no names file given in ini file"); throw OSRMException("no names file found");
}
if( server_paths.find("geometry") == server_paths.end() ) {
throw OSRMException("no geometry file found");
} }
ServerPaths::const_iterator paths_iterator = server_paths.find("hsgrdata"); ServerPaths::const_iterator paths_iterator = server_paths.find("hsgrdata");
@ -139,8 +142,7 @@ int main( const int argc, const char * argv[] )
BOOST_ASSERT(server_paths.end() != paths_iterator); BOOST_ASSERT(server_paths.end() != paths_iterator);
BOOST_ASSERT(!paths_iterator->second.empty()); BOOST_ASSERT(!paths_iterator->second.empty());
const boost::filesystem::path & names_data_path = paths_iterator->second; const boost::filesystem::path & names_data_path = paths_iterator->second;
paths_iterator = server_paths.find("geometry");
paths_iterator = server_paths.find("geometries");
BOOST_ASSERT(server_paths.end() != paths_iterator); BOOST_ASSERT(server_paths.end() != paths_iterator);
BOOST_ASSERT(!paths_iterator->second.empty()); BOOST_ASSERT(!paths_iterator->second.empty());
const boost::filesystem::path & geometries_data_path = paths_iterator->second; const boost::filesystem::path & geometries_data_path = paths_iterator->second;