Partially fixes issue #420

This commit is contained in:
DennisOSRM 2012-09-19 17:06:35 +02:00
parent 09088e71b5
commit 75cd287ab0
2 changed files with 10 additions and 2 deletions

View File

@ -68,6 +68,8 @@ public:
iif = std::string(_i);
ramIndexTable.resize((1024*1024), ULONG_MAX);
ramInFile.open(rif, std::ios::in | std::ios::binary);
if(!ramInFile) { ERR(rif << " not found"); }
}
~NNGrid() {

View File

@ -25,6 +25,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
QueryObjectsStorage::QueryObjectsStorage(std::string hsgrPath, std::string ramIndexPath, std::string fileIndexPath, std::string nodesPath, std::string edgesPath, std::string namesPath, std::string timestampPath) {
INFO("loading graph data");
std::ifstream hsgrInStream(hsgrPath.c_str(), std::ios::binary);
if(!hsgrInStream) { ERR(hsgrPath << " not found"); }
//Deserialize road network graph
std::vector< QueryGraph::_StrNode> nodeList;
std::vector< QueryGraph::_StrEdge> edgeList;
@ -36,8 +37,10 @@ QueryObjectsStorage::QueryObjectsStorage(std::string hsgrPath, std::string ramIn
assert(0 == edgeList.size());
if(timestampPath.length()) {
INFO("Loading Timestamp")
std::ifstream timestampInStream(timestampPath.c_str());
INFO("Loading Timestamp");
std::ifstream timestampInStream(timestampPath.c_str());
if(!timestampInStream) { ERR(timestampPath << " not found"); }
getline(timestampInStream, timestamp);
timestampInStream.close();
}
@ -49,13 +52,16 @@ QueryObjectsStorage::QueryObjectsStorage(std::string hsgrPath, std::string ramIn
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(), n, checkSum);
nodeHelpDesk->initNNGrid(nodesInStream, edgesInStream);
//deserialize street name list
INFO("Loading names index");
std::ifstream namesInStream(namesPath.c_str(), std::ios::binary);
if(!namesInStream) { ERR(namesPath << " not found"); }
unsigned size(0);
namesInStream.read((char *)&size, sizeof(unsigned));
// names = new std::vector<std::string>();