From e9258a238ec07c349c89992a639b388de36df3fb Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 21 Jan 2012 23:10:23 +0000 Subject: [PATCH 01/15] add pthread check to SConscript so subsequent google protocol buffers check doesn't fail --- SConstruct | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SConstruct b/SConstruct index b36216746..eb1566e04 100644 --- a/SConstruct +++ b/SConstruct @@ -98,6 +98,9 @@ if not conf.CheckLibWithHeader('bz2', 'bzlib.h', 'CXX'): if not conf.CheckLibWithHeader('libzip', 'zip.h', 'CXX'): print "Zip library not found. Exiting" Exit(-1) +if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'CXX'): + print "pthread not found. Exiting" + Exit(-1) if not conf.CheckLibWithHeader('protobuf', 'google/protobuf/descriptor.h', 'CXX'): print "Google Protobuffer library not found. Exiting" Exit(-1) From 7d21a4e0fb6352fb73427f8930de131f6afd5551 Mon Sep 17 00:00:00 2001 From: Dr Scott Date: Thu, 26 Jan 2012 00:53:53 +0100 Subject: [PATCH 02/15] fixing some memory problems --- Contractor/EdgeBasedGraphFactory.cpp | 4 ++-- createHierarchy.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 18a7c86e7..d35820dd1 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -146,7 +146,7 @@ void EdgeBasedGraphFactory::Run() { } } ++secondRestrictionIterator; - } while(u == secondRestrictionIterator->fromNode); + } while(secondRestrictionIterator != inputRestrictions.end() && u == secondRestrictionIterator->fromNode); } if(_nodeBasedGraph->EndEdges(v) == _nodeBasedGraph->BeginEdges(v) + 1 && _nodeBasedGraph->GetEdgeData(e1).type != INT_MAX) { EdgeBasedNode currentNode; @@ -194,7 +194,7 @@ void EdgeBasedGraphFactory::Run() { } } ++secondRestrictionIterator; - } while(u == secondRestrictionIterator->fromNode); + } while(secondRestrictionIterator != inputRestrictions.end() && u == secondRestrictionIterator->fromNode); } if( !isTurnRestricted || (isOnlyAllowed && w == onlyToNode) ) { //only add an edge if turn is not prohibited diff --git a/createHierarchy.cpp b/createHierarchy.cpp index d03cc78e4..b7185f802 100644 --- a/createHierarchy.cpp +++ b/createHierarchy.cpp @@ -155,6 +155,7 @@ int main (int argc, char *argv[]) { std::vector< ContractionCleanup::Edge > contractedEdges; contractor->GetEdges( contractedEdges ); + delete contractor; ContractionCleanup * cleanup = new ContractionCleanup(n, contractedEdges); contractedEdges.clear(); From bef3aad423bf8e8e5df3f5dbb536d2852f5e17b1 Mon Sep 17 00:00:00 2001 From: Dr Scott Date: Thu, 26 Jan 2012 23:03:39 +0100 Subject: [PATCH 03/15] another memory problem --- createHierarchy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/createHierarchy.cpp b/createHierarchy.cpp index b7185f802..17b6e37ed 100644 --- a/createHierarchy.cpp +++ b/createHierarchy.cpp @@ -184,7 +184,7 @@ int main (int argc, char *argv[]) { numberOfNodes+=1; std::vector< StaticGraph::_StrNode > _nodes; - _nodes.resize( numberOfNodes); + _nodes.resize( numberOfNodes + 1 ); StaticGraph::EdgeIterator edge = 0; StaticGraph::EdgeIterator position = 0; From 571824415c3a9ba6c5e051d80f6061f849ced96a Mon Sep 17 00:00:00 2001 From: Dr Scott Date: Fri, 27 Jan 2012 00:41:31 +0100 Subject: [PATCH 04/15] memory problem (because of n+1 in StaticGraph::EndEdges) --- Util/GraphLoader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Util/GraphLoader.h b/Util/GraphLoader.h index 75dbfad4b..099d390dd 100644 --- a/Util/GraphLoader.h +++ b/Util/GraphLoader.h @@ -364,7 +364,7 @@ template unsigned readHSGRFromStream(istream &in, vector& nodeList, vector & edgeList) { unsigned numberOfNodes = 0; in.read((char*) & numberOfNodes, sizeof(unsigned)); - nodeList.resize(numberOfNodes); + nodeList.resize(numberOfNodes + 1); NodeT currentNode; for(unsigned nodeCounter = 0; nodeCounter < numberOfNodes; ++nodeCounter ) { in.read((char*) ¤tNode, sizeof(NodeT)); From 835bf436e4535dc10d9c13abe56486b4bb0a6fc9 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 31 Jan 2012 14:48:46 +0100 Subject: [PATCH 05/15] Extractor dies more gracefully now if the stxxl singleton is already in use. --- extractor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extractor.cpp b/extractor.cpp index d85013f31..cc5a129ba 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -69,8 +69,16 @@ bool removeIfUnused(ClassT n) { return (false == n.used); } int main (int argc, char *argv[]) { + GUARANTEE((argc > 1) ,"usage: \n" << argv[0] << " "); + //Check if another instance of stxxl is already running or if there is a general problem + try { + stxxl::vector testForRunningInstance; + } catch(std::exception & e) { + ERR("Could not instantiate STXXL layer." << std::endl << e.what()); + } + INFO("extracting data from input file " << argv[1]); bool isPBF(false); std::string outputFileName(argv[1]); From d41b0f28b40b2439af48d2e00fbabc69d8fa5e79 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 31 Jan 2012 16:12:19 +0100 Subject: [PATCH 06/15] Fixes issue #94. --- Contractor/EdgeBasedGraphFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index d35820dd1..38658a9a7 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -148,7 +148,7 @@ void EdgeBasedGraphFactory::Run() { ++secondRestrictionIterator; } while(secondRestrictionIterator != inputRestrictions.end() && u == secondRestrictionIterator->fromNode); } - if(_nodeBasedGraph->EndEdges(v) == _nodeBasedGraph->BeginEdges(v) + 1 && _nodeBasedGraph->GetEdgeData(e1).type != INT_MAX) { + if(_nodeBasedGraph->EndEdges(v) == _nodeBasedGraph->BeginEdges(v) + 1 && _nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX) { EdgeBasedNode currentNode; currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID; currentNode.lat1 = inputNodeInfoList[u].lat; From 93b1ff1c5d1a0e6e6f433cdf826995e6369b0046 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 31 Jan 2012 17:44:55 +0100 Subject: [PATCH 07/15] Fixing constant-sized memory leaks --- DataStructures/BaseParser.h | 2 +- DataStructures/ExtractorCallBacks.h | 14 ++++++++++++-- DataStructures/PBFParser.h | 24 +++++++++--------------- DataStructures/XMLParser.h | 2 +- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/DataStructures/BaseParser.h b/DataStructures/BaseParser.h index 32ed8cfc7..d3cb226aa 100644 --- a/DataStructures/BaseParser.h +++ b/DataStructures/BaseParser.h @@ -26,7 +26,7 @@ class BaseParser { public: virtual ~BaseParser() {} virtual bool Init() = 0; - virtual bool RegisterCallbacks(bool (*nodeCallbackPointer)(NodeT), bool (*restrictionCallbackPointer)(RestrictionT), bool (*wayCallbackPointer)(WayT), bool (*addressCallbackPointer)(NodeT, HashTable)) = 0; + virtual bool RegisterCallbacks(bool (*nodeCallbackPointer)(NodeT), bool (*restrictionCallbackPointer)(RestrictionT), bool (*wayCallbackPointer)(WayT), bool (*addressCallbackPointer)(NodeT, HashTable&)) = 0; virtual bool Parse() = 0; }; diff --git a/DataStructures/ExtractorCallBacks.h b/DataStructures/ExtractorCallBacks.h index 1c8fc5b3b..98feed5dd 100644 --- a/DataStructures/ExtractorCallBacks.h +++ b/DataStructures/ExtractorCallBacks.h @@ -29,7 +29,7 @@ typedef stxxl::vector STXXLNodeIDVector; typedef stxxl::vector<_Node> STXXLNodeVector; typedef stxxl::vector<_Edge> STXXLEdgeVector; typedef stxxl::vector<_Address> STXXLAddressVector; -typedef stxxl::vector STXXLStringVector; +typedef stxxl::vector STXXLStringVector; typedef stxxl::vector<_RawRestrictionContainer> STXXLRestrictionsVector; typedef stxxl::vector<_WayIDStartAndEndEdge> STXXLWayIDStartEndVector; @@ -42,6 +42,16 @@ struct STXXLContainers { STXXLStringVector nameVector; STXXLRestrictionsVector restrictionsVector; STXXLWayIDStartEndVector wayStartEndVector; + + ~STXXLContainers() { + usedNodeIDs.clear(); + allNodes.clear(); + allEdges.clear(); + adressVector.clear(); + nameVector.clear(); + restrictionsVector.clear(); + wayStartEndVector.clear(); + } }; class ExtractorCallbacks{ @@ -51,7 +61,7 @@ private: STXXLContainers * externalMemory; public: - ExtractorCallbacks(STXXLContainers * ext, Settings set, StringMap * strMap){ + ExtractorCallbacks(STXXLContainers * ext, Settings set, StringMap * strMap) { externalMemory = ext; settings = set; stringMap = strMap; diff --git a/DataStructures/PBFParser.h b/DataStructures/PBFParser.h index ecff19c26..efc435885 100644 --- a/DataStructures/PBFParser.h +++ b/DataStructures/PBFParser.h @@ -22,6 +22,7 @@ or see http://www.gnu.org/licenses/agpl.txt. #define PBFPARSER_H_ #include +#include #include "BaseParser.h" @@ -61,9 +62,9 @@ class PBFParser : public BaseParser<_Node, _RawRestrictionContainer, _Way> { }; public: - PBFParser(const char * fileName) - : threadDataQueue( new ConcurrentQueue<_ThreadData*>(25) ) { /* Max 25 items in queue */ + PBFParser(const char * fileName) { /* Max 25 items in queue */ GOOGLE_PROTOBUF_VERIFY_VERSION; + threadDataQueue.reset( new ConcurrentQueue<_ThreadData*>(25) ); input.open(fileName, std::ios::in | std::ios::binary); if (!input) { @@ -78,7 +79,7 @@ public: addressCallback = NULL; restrictionCallback = NULL; } - bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*restrictionCallbackPointer)(_RawRestrictionContainer), bool (*wayCallbackPointer)(_Way),bool (*addressCallbackPointer)(_Node, HashTable) ) { + bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*restrictionCallbackPointer)(_RawRestrictionContainer), bool (*wayCallbackPointer)(_Way),bool (*addressCallbackPointer)(_Node, HashTable&) ) { nodeCallback = *nodeCallbackPointer; wayCallback = *wayCallbackPointer; restrictionCallback = *restrictionCallbackPointer; @@ -95,8 +96,6 @@ public: while (threadDataQueue->try_pop(td)) { delete td; } - delete threadDataQueue; - google::protobuf::ShutdownProtobufLibrary(); #ifndef NDEBUG @@ -145,8 +144,10 @@ public: if (keepRunning) threadDataQueue->push(threadData); - else + else { threadDataQueue->push(NULL); // No more data to read, parse stops when NULL encountered + delete threadData; + } } while(keepRunning); } @@ -219,13 +220,6 @@ private: int keyValue = dense.keys_vals ( denseTagIndex+1 ); std::string key = threadData->PBFprimitiveBlock.stringtable().s(tagValue).data(); std::string value = threadData->PBFprimitiveBlock.stringtable().s(keyValue).data(); - - if("barrier" == key && "bollard" == value) { - n.bollard = true; - } - if("highway" == key && "traffic_signals" == value) { - n.trafficLight = true; - } keyVals.Add(key, value); denseTagIndex += 2; } @@ -531,12 +525,12 @@ private: bool (*nodeCallback)(_Node); bool (*wayCallback)(_Way); bool (*restrictionCallback)(_RawRestrictionContainer); - bool (*addressCallback)(_Node, HashTable); + bool (*addressCallback)(_Node, HashTable&); /* the input stream to parse */ std::fstream input; /* ThreadData Queue */ - ConcurrentQueue < _ThreadData* >* threadDataQueue; + boost::shared_ptr > threadDataQueue; }; #endif /* PBFPARSER_H_ */ diff --git a/DataStructures/XMLParser.h b/DataStructures/XMLParser.h index 672268813..9bfb3ae48 100644 --- a/DataStructures/XMLParser.h +++ b/DataStructures/XMLParser.h @@ -37,7 +37,7 @@ public: } virtual ~XMLParser() {} - bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*restrictionCallbackPointer)(_RawRestrictionContainer), bool (*wayCallbackPointer)(_Way), bool (*addressCallbackPointer)(_Node, HashTable) ) { + bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*restrictionCallbackPointer)(_RawRestrictionContainer), bool (*wayCallbackPointer)(_Way), bool (*addressCallbackPointer)(_Node, HashTable&) ) { nodeCallback = *nodeCallbackPointer; wayCallback = *wayCallbackPointer; restrictionCallback = *restrictionCallbackPointer; From f68d53ead6c6fd1eb73ba519e06e9079d655e15b Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 31 Jan 2012 17:46:04 +0100 Subject: [PATCH 08/15] Fixing off-by one error --- DataStructures/NNGrid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataStructures/NNGrid.h b/DataStructures/NNGrid.h index 830c63bfe..d4b523652 100644 --- a/DataStructures/NNGrid.h +++ b/DataStructures/NNGrid.h @@ -484,7 +484,7 @@ private: assert( x<=1.0 && x >= 0); assert( y<=1.0 && y >= 0); - unsigned line = 1073741824.0*y; + unsigned line = (32768 * (32768-1))*y; line = line - (line % 32768); assert(line % 32768 == 0); unsigned column = 32768.*x; From 8a665bc04405a4f577713847e87422c5755680c7 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 31 Jan 2012 20:38:52 +0100 Subject: [PATCH 09/15] Fixes issue #73. --- DataStructures/PBFParser.h | 25 +++++++++++++------------ extractor.cpp | 11 ++++++----- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/DataStructures/PBFParser.h b/DataStructures/PBFParser.h index efc435885..453bbd30e 100644 --- a/DataStructures/PBFParser.h +++ b/DataStructures/PBFParser.h @@ -358,7 +358,7 @@ private: } void loadBlock(_ThreadData * threadData) { - blockCount++; + ++blockCount; threadData->currentGroupID = 0; threadData->currentEntityID = 0; } @@ -380,14 +380,14 @@ private: if ( size > MAX_BLOB_HEADER_SIZE || size < 0 ) { return false; } - char *data = (char*)malloc(size); + char *data = new char[size]; stream.read(data, size*sizeof(data[0])); if ( !(threadData->PBFBlobHeader).ParseFromArray( data, size ) ){ - free(data); + delete[] data; return false; } - free(data); + delete[] data; return true; } @@ -487,25 +487,26 @@ private: return false; } - if ( !readPBFBlobHeader(stream, threadData) ) - return false; - - if ( threadData->PBFBlobHeader.type() != "OSMData" ) { - std::cerr << "[error] invalid block type, found" << threadData->PBFBlobHeader.type().data() << "instead of OSMData" << std::endl; + if ( !readPBFBlobHeader(stream, threadData) ){ return false; } - if ( !readBlob(stream, threadData) ) + if ( threadData->PBFBlobHeader.type() != "OSMData" ) { return false; + } + + if ( !readBlob(stream, threadData) ) { + return false; + } if ( !threadData->PBFprimitiveBlock.ParseFromArray( &(threadData->charBuffer[0]), threadData-> charBuffer.size() ) ) { - std::cerr << "[error] failed to parse PrimitiveBlock" << std::endl; + ERR("failed to parse PrimitiveBlock"); return false; } return true; } - static Endianness getMachineEndianness() { + Endianness getMachineEndianness() const { int i(1); char *p = (char *) &i; if (p[0] == 1) diff --git a/extractor.cpp b/extractor.cpp index cc5a129ba..f2f1f7df4 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -60,7 +60,7 @@ unsigned globalRestrictionCounter = 0; ExtractorCallbacks * extractCallBacks; bool nodeFunction(_Node n); -bool adressFunction(_Node n, HashTable keyVals); +bool adressFunction(_Node n, HashTable & keyVals); bool restrictionFunction(_RawRestrictionContainer r); bool wayFunction(_Way w); @@ -190,10 +190,9 @@ int main (int argc, char *argv[]) { parser = new XMLParser(argv[1]); } parser->RegisterCallbacks(&nodeFunction, &restrictionFunction, &wayFunction, &adressFunction); - GUARANTEE(parser->Init(), "Parser not initialized!"); + if(!parser->Init()) + INFO("Parser not initialized!"); parser->Parse(); - DELETE(parser); - stringMap.clear(); try { // INFO("raw no. of names: " << externalMemory.nameVector.size()); @@ -485,7 +484,9 @@ int main (int argc, char *argv[]) { cerr << "Caught Execption:" << e.what() << endl; return false; } + DELETE(parser); + stringMap.clear(); delete extractCallBacks; cout << "[extractor] finished." << endl; return 0; @@ -496,7 +497,7 @@ bool nodeFunction(_Node n) { return true; } -bool adressFunction(_Node n, HashTable keyVals){ +bool adressFunction(_Node n, HashTable & keyVals){ extractCallBacks->adressFunction(n, keyVals); return true; } From ea6c0353be8a065920701b95fcf276317be11785 Mon Sep 17 00:00:00 2001 From: Dr Scott Date: Tue, 31 Jan 2012 23:23:42 +0100 Subject: [PATCH 10/15] authors --- AUTHORS.TXT | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS.TXT b/AUTHORS.TXT index b359a3d82..8268ebd7f 100644 --- a/AUTHORS.TXT +++ b/AUTHORS.TXT @@ -7,4 +7,5 @@ Frederik Ramm Bharath Vissapragada Pascal Neis Sasa Ivetic -Emil Tin \ No newline at end of file +Emil Tin +Henning Moll From b44e36e7ba1f0a0c800b4d03aa085d20beb05d71 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Wed, 1 Feb 2012 17:36:28 +0100 Subject: [PATCH 11/15] Fixes issue #74, thanks DrVanScott. --- DataStructures/ExtractorCallBacks.h | 1 - 1 file changed, 1 deletion(-) diff --git a/DataStructures/ExtractorCallBacks.h b/DataStructures/ExtractorCallBacks.h index 98feed5dd..9e63a42a0 100644 --- a/DataStructures/ExtractorCallBacks.h +++ b/DataStructures/ExtractorCallBacks.h @@ -173,7 +173,6 @@ public: w.direction = _Way::bidirectional; } else if( oneway == "-1") { w.direction = _Way::opposite; - std::reverse( w.path.begin(), w.path.end() ); } else if( oneway == "yes" || oneway == "1" || oneway == "true" || onewayClass == "yes" || onewayClass == "1" || onewayClass == "true" || junction == "roundabout" || highway == "motorway_link" || highway == "motorway" ) { w.direction = _Way::oneway; From 6996b24c4485eccfdf2f5b832ddb7ed826700117 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Fri, 3 Feb 2012 13:44:08 +0100 Subject: [PATCH 12/15] Unnecessary memory allocation removed in extractor --- extractor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extractor.cpp b/extractor.cpp index f2f1f7df4..d3fb12931 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -453,10 +453,9 @@ int main (int argc, char *argv[]) { cout << "ok" << endl; time = get_timestamp(); cout << "[extractor] writing street name index ... " << flush; - vector * nameIndex = new vector(externalMemory.nameVector.size()+1, 0); outputFileName.append(".names"); ofstream nameOutFile(outputFileName.c_str(), ios::binary); - unsigned sizeOfNameIndex = nameIndex->size(); + unsigned sizeOfNameIndex = externalMemory.nameVector.size(); nameOutFile.write((char *)&(sizeOfNameIndex), sizeof(unsigned)); BOOST_FOREACH(string str, externalMemory.nameVector) { @@ -466,7 +465,6 @@ int main (int argc, char *argv[]) { } nameOutFile.close(); - delete nameIndex; cout << "ok, after " << get_timestamp() - time << "s" << endl; // time = get_timestamp(); From 1f986598f1732f65e7ac7a480543b77447f77ffa Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Fri, 3 Feb 2012 13:45:59 +0100 Subject: [PATCH 13/15] Fixing issue #89 where the first street name could not be properly adressed. --- DataStructures/ExtractorCallBacks.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DataStructures/ExtractorCallBacks.h b/DataStructures/ExtractorCallBacks.h index 9e63a42a0..e06f60374 100644 --- a/DataStructures/ExtractorCallBacks.h +++ b/DataStructures/ExtractorCallBacks.h @@ -43,6 +43,10 @@ struct STXXLContainers { STXXLRestrictionsVector restrictionsVector; STXXLWayIDStartEndVector wayStartEndVector; + STXXLContainers() { + nameVector.push_back(""); + } + ~STXXLContainers() { usedNodeIDs.clear(); allNodes.clear(); From 204f522ea43298f18e6192ac9be5b63898298550 Mon Sep 17 00:00:00 2001 From: Frederik Ramm Date: Fri, 3 Feb 2012 15:43:22 +0100 Subject: [PATCH 14/15] add dependency & stxxl config info tho readme --- README.TXT | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.TXT b/README.TXT index c51dfec5b..1cf23b29f 100644 --- a/README.TXT +++ b/README.TXT @@ -3,13 +3,18 @@ Compilation Compiling the source code is easy. If you are running a decent linux installing dependencies and running make should suffice. Make sure the following -dependencies are installed: +dependencies are installed (for libraries choose the -dev packages): - Boost 1.41+ - g++ 4.2+ - libxml2 2.7+ - scons 2.10+ - stxxl 1.3.1+ + - libprotobuf 2.3.0+ (also protobuf-compiler) + - libbz2 any + - libzip any + - libmagic++ (from ImageMagick) + Building the binaries is done by using scons. It should check for required libraries and header files and report missing ones.The Scons script accepts @@ -72,7 +77,12 @@ preprocessing runs in three steps, all done by seperate programs. 'osrm-extract file.osm' extracts the road network of an osm file. This is necessary, because the osm data is not made to support fast routing out of the -box. The output of the step is a file called 'file.osrm' +box. The output of the step is a file called 'file.osrm'. + +'osrm-extract' makes heavy use of STXXL memory management; STXXL will create +a temporary file in /var/tmp. If you would prefer space allocated elsewhere, +create a file named '.stxxl' in the current directory and specify the location +and size of the virtual disk there, e.g. 'disk=./stxxl,20480,syscall'. 'osrm-prepare file.osrm file.restrictions' preprocesses the road network and computes additional information that is exploited later to speed up the path @@ -83,9 +93,9 @@ information. 'osrm-routed' starts the server on TCP Port 5000. The server communicates over http and can be queried by any browser or http-capable -command line tool. The server responds with KML-formatted output.Assume the +command line tool. The server responds with KML-formatted output.i Assume the server is installed on machine localhost and a map containing the Netherlands -has been installed. Computing a route from Amsterdam to Den Haag can be done by +has been installed. Computing a route from Amsterdam to The Hague can be done by calling http://localhost:5000/route&52.370197&4.890444&52.048167&4.3175 which gives a shortest (fastest) route between the two points. To locate a From 2fd3ebc8fbc9339c7a78025d5dd84d1c01f6f113 Mon Sep 17 00:00:00 2001 From: Frederik Ramm Date: Fri, 3 Feb 2012 15:45:45 +0100 Subject: [PATCH 15/15] typo fix --- README.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.TXT b/README.TXT index 1cf23b29f..7d4c3beb4 100644 --- a/README.TXT +++ b/README.TXT @@ -93,7 +93,7 @@ information. 'osrm-routed' starts the server on TCP Port 5000. The server communicates over http and can be queried by any browser or http-capable -command line tool. The server responds with KML-formatted output.i Assume the +command line tool. The server responds with KML-formatted output. Assume the server is installed on machine localhost and a map containing the Netherlands has been installed. Computing a route from Amsterdam to The Hague can be done by calling