Check for valid data files. Implements #224

This commit is contained in:
DennisOSRM
2013-07-22 16:34:06 +02:00
parent 0367399c89
commit 4a39a4af1c
9 changed files with 123 additions and 43 deletions
@@ -58,24 +58,23 @@ QueryObjectsStorage::QueryObjectsStorage(
getline(timestampInStream, timestamp);
timestampInStream.close();
}
if(!timestamp.length())
if(!timestamp.length()) {
timestamp = "n/a";
if(25 < timestamp.length())
}
if(25 < timestamp.length()) {
timestamp.resize(25);
}
INFO("Loading auxiliary information");
//Init nearest neighbor data structure
std::ifstream nodesInStream(nodesPath.c_str(), std::ios::binary);
if(!nodesInStream) { ERR(nodesPath << " not found"); }
std::ifstream edgesInStream(edgesPath.c_str(), std::ios::binary);
if(!edgesInStream) { ERR(edgesPath << " not found"); }
nodeHelpDesk = new NodeInformationHelpDesk(
ramIndexPath.c_str(),
fileIndexPath.c_str(),
ramIndexPath,
fileIndexPath,
nodesPath,
edgesPath,
n,
checkSum
);
nodeHelpDesk->initNNGrid(nodesInStream, edgesInStream);
//deserialize street name list
INFO("Loading names index");