SRTM Root directory parsed from ini file

This commit is contained in:
DennisOSRM 2011-12-13 15:30:52 +01:00
parent a04eb2bba1
commit 9ea39d280c
2 changed files with 7 additions and 1 deletions

View File

@ -1 +1,2 @@
Threads = 4
SRTM = /opt/storage/srtm/Eurasia

View File

@ -76,11 +76,16 @@ int main (int argc, char *argv[]) {
INFO("Loaded " << inputRestrictions.size() << " restrictions from file");
unsigned numberOfThreads = omp_get_num_procs();
std::string SRTM_ROOT;
if(testDataFile("contractor.ini")) {
ContractorConfiguration contractorConfig("contractor.ini");
if(atoi(contractorConfig.GetParameter("Threads").c_str()) != 0 && (unsigned)atoi(contractorConfig.GetParameter("Threads").c_str()) <= numberOfThreads)
numberOfThreads = (unsigned)atoi( contractorConfig.GetParameter("Threads").c_str() );
if(0 < contractorConfig.GetParameter("SRTM").size() )
SRTM_ROOT = contractorConfig.GetParameter("SRTM");
}
if(0 != SRTM_ROOT.size())
INFO("Loading SRTM from/to " << SRTM_ROOT);
omp_set_num_threads(numberOfThreads);
INFO("preprocessing data from input file " << argv[1] << " using STL "
@ -106,7 +111,7 @@ int main (int argc, char *argv[]) {
NodeID n = readBinaryOSRMGraphFromStream(in, edgeList, &internalToExternaleNodeMapping, inputRestrictions);
in.close();
EdgeBasedGraphFactory * edgeBasedGraphFactory = new EdgeBasedGraphFactory (n, edgeList, inputRestrictions, internalToExternaleNodeMapping);
EdgeBasedGraphFactory * edgeBasedGraphFactory = new EdgeBasedGraphFactory (n, edgeList, inputRestrictions, internalToExternaleNodeMapping, SRTM_ROOT);
edgeList.clear();
std::vector<ImportEdge>().swap(edgeList);