Implements #692
This commit is contained in:
parent
e86e8c37a8
commit
0765ebf735
@ -38,7 +38,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
typedef EdgeBasedGraphFactory::EdgeBasedNode RTreeLeaf;
|
typedef EdgeBasedGraphFactory::EdgeBasedNode RTreeLeaf;
|
||||||
|
|
||||||
class NodeInformationHelpDesk : boost::noncopyable{
|
class NodeInformationHelpDesk : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
NodeInformationHelpDesk(
|
NodeInformationHelpDesk(
|
||||||
const std::string & ramIndexInput,
|
const std::string & ramIndexInput,
|
||||||
@ -47,8 +47,21 @@ public:
|
|||||||
const std::string & edges_filename,
|
const std::string & edges_filename,
|
||||||
const unsigned number_of_nodes,
|
const unsigned number_of_nodes,
|
||||||
const unsigned check_sum
|
const unsigned check_sum
|
||||||
) : number_of_nodes(number_of_nodes), check_sum(check_sum)
|
) : number_of_nodes(number_of_nodes), check_sum(check_sum)
|
||||||
{
|
{
|
||||||
|
if ( "" == ramIndexInput ) {
|
||||||
|
throw OSRMException("no ram index file name in server ini");
|
||||||
|
}
|
||||||
|
if ( "" == fileIndexInput ) {
|
||||||
|
throw OSRMException("no mem index file name in server ini");
|
||||||
|
}
|
||||||
|
if ( "" == nodes_filename ) {
|
||||||
|
throw OSRMException("no nodes file name in server ini");
|
||||||
|
}
|
||||||
|
if ( "" == edges_filename ) {
|
||||||
|
throw OSRMException("no edges file name in server ini");
|
||||||
|
}
|
||||||
|
|
||||||
read_only_rtree = new StaticRTree<RTreeLeaf>(
|
read_only_rtree = new StaticRTree<RTreeLeaf>(
|
||||||
ramIndexInput,
|
ramIndexInput,
|
||||||
fileIndexInput
|
fileIndexInput
|
||||||
@ -136,7 +149,7 @@ private:
|
|||||||
throw OSRMException("edges file not found");
|
throw OSRMException("edges file not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleLogger().Write(logDEBUG) << "Loading node data";
|
SimpleLogger().Write(logDEBUG) << "Loading node data" << nodes_file.length() << " ->" << nodes_file << "<-";
|
||||||
NodeInfo b;
|
NodeInfo b;
|
||||||
while(!nodes_input_stream.eof()) {
|
while(!nodes_input_stream.eof()) {
|
||||||
nodes_input_stream.read((char *)&b, sizeof(NodeInfo));
|
nodes_input_stream.read((char *)&b, sizeof(NodeInfo));
|
||||||
|
@ -30,6 +30,22 @@ OSRM::OSRM(const char * server_ini_path) {
|
|||||||
boost::filesystem::path base_path =
|
boost::filesystem::path base_path =
|
||||||
boost::filesystem::absolute(server_ini_path).parent_path();
|
boost::filesystem::absolute(server_ini_path).parent_path();
|
||||||
|
|
||||||
|
if ( !serverConfig.Holds("hsgrData")) {
|
||||||
|
throw OSRMException("no ram index file name in server ini");
|
||||||
|
}
|
||||||
|
if ( !serverConfig.Holds("ramIndex") ) {
|
||||||
|
throw OSRMException("no mem index file name in server ini");
|
||||||
|
}
|
||||||
|
if ( !serverConfig.Holds("fileIndex") ) {
|
||||||
|
throw OSRMException("no nodes file name in server ini");
|
||||||
|
}
|
||||||
|
if ( !serverConfig.Holds("nodesData") ) {
|
||||||
|
throw OSRMException("no nodes file name in server ini");
|
||||||
|
}
|
||||||
|
if ( !serverConfig.Holds("edgesData") ) {
|
||||||
|
throw OSRMException("no edges file name in server ini");
|
||||||
|
}
|
||||||
|
|
||||||
boost::filesystem::path hsgr_path = boost::filesystem::absolute(
|
boost::filesystem::path hsgr_path = boost::filesystem::absolute(
|
||||||
serverConfig.GetParameter("hsgrData"),
|
serverConfig.GetParameter("hsgrData"),
|
||||||
base_path
|
base_path
|
||||||
|
@ -30,6 +30,25 @@ QueryObjectsStorage::QueryObjectsStorage(
|
|||||||
const std::string & namesPath,
|
const std::string & namesPath,
|
||||||
const std::string & timestampPath
|
const std::string & timestampPath
|
||||||
) {
|
) {
|
||||||
|
if("" == hsgrPath) {
|
||||||
|
throw OSRMException("no hsgr file given in ini file");
|
||||||
|
}
|
||||||
|
if("" == ramIndexPath) {
|
||||||
|
throw OSRMException("no ram index file given in ini file");
|
||||||
|
}
|
||||||
|
if("" == fileIndexPath) {
|
||||||
|
throw OSRMException("no mem index file given in ini file");
|
||||||
|
}
|
||||||
|
if("" == nodesPath) {
|
||||||
|
throw OSRMException("no nodes file given in ini file");
|
||||||
|
}
|
||||||
|
if("" == edgesPath) {
|
||||||
|
throw OSRMException("no edges file given in ini file");
|
||||||
|
}
|
||||||
|
if("" == namesPath) {
|
||||||
|
throw OSRMException("no names file given in ini file");
|
||||||
|
}
|
||||||
|
|
||||||
SimpleLogger().Write() << "loading graph data";
|
SimpleLogger().Write() << "loading graph data";
|
||||||
std::ifstream hsgrInStream(hsgrPath.c_str(), std::ios::binary);
|
std::ifstream hsgrInStream(hsgrPath.c_str(), std::ios::binary);
|
||||||
if(!hsgrInStream) {
|
if(!hsgrInStream) {
|
||||||
|
@ -54,7 +54,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string GetParameter(const std::string & key){
|
std::string GetParameter(const std::string & key){
|
||||||
return parameters.Find(key);
|
return parameters.Find(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Holds(const std::string & key) const {
|
||||||
|
return parameters.Holds(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetParameter(const char* key, const char* value) {
|
void SetParameter(const char* key, const char* value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user