diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index a936d90df..6d2c78558 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -29,8 +29,8 @@ #include "EdgeBasedGraphFactory.h" template<> -EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector & inputEdges, std::vector<_Restriction> & irs, std::vector & nI) -: inputRestrictions(irs), inputNodeInfoList(nI) { +EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector & inputEdges, std::vector<_Restriction> & irs, std::vector & nI, std::string & srtm) +: inputRestrictions(irs), inputNodeInfoList(nI)/*, srtmLookup(srtm) */{ #ifdef _GLIBCXX_PARALLEL __gnu_parallel::sort(inputRestrictions.begin(), inputRestrictions.end(), CmpRestrictionByFrom); @@ -141,12 +141,12 @@ void EdgeBasedGraphFactory::Run() { currentNode.lon2 = inputNodeInfoList[v].lon; currentNode.id = _nodeBasedGraph->GetEdgeData(e1).edgeBasedNodeID; - short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. ); - short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. ); - short heightDiff = startHeight - targetHeight; - double increase = (heightDiff/ApproximateDistance(currentNode.lat1, currentNode.lon1, currentNode.lat2, currentNode.lon2)); - if(heightDiff != 0) - INFO("Increase at dead-end street: " << heightDiff << ", edge length: " << ApproximateDistance(currentNode.lat1, currentNode.lon1, currentNode.lat2, currentNode.lon2) << ", percentage: " << increase ); +// short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. ); +// short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. ); +// short heightDiff = startHeight - targetHeight; +// double increase = (heightDiff/ApproximateDistance(currentNode.lat1, currentNode.lon1, currentNode.lat2, currentNode.lon2)); +// if(heightDiff != 0) +// INFO("Increase at dead-end street: " << heightDiff << ", edge length: " << ApproximateDistance(currentNode.lat1, currentNode.lon1, currentNode.lat2, currentNode.lon2) << ", percentage: " << increase ); //incorporate height diff; //todo: get some exponential function to converge to one for n->\infty diff --git a/Contractor/EdgeBasedGraphFactory.h b/Contractor/EdgeBasedGraphFactory.h index 05825faf1..cd210f5e2 100644 --- a/Contractor/EdgeBasedGraphFactory.h +++ b/Contractor/EdgeBasedGraphFactory.h @@ -34,6 +34,7 @@ #include "../DataStructures/ImportEdge.h" #include "../DataStructures/Percent.h" #include "../DataStructures/TurnInstructions.h" +//#include "../Util/SRTMLookup.h" class EdgeBasedGraphFactory { private: @@ -88,9 +89,11 @@ private: template double GetAngleBetweenTwoEdges(const CoordinateT& A, const CoordinateT& C, const CoordinateT& B) const; +// SRTMLookup srtmLookup; + public: template< class InputEdgeT > - explicit EdgeBasedGraphFactory(int nodes, std::vector & inputEdges, std::vector<_Restriction> & inputRestrictions, std::vector & nI); + explicit EdgeBasedGraphFactory(int nodes, std::vector & inputEdges, std::vector<_Restriction> & inputRestrictions, std::vector & nI, std::string & srtm); virtual ~EdgeBasedGraphFactory(); void Run();