diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index c440dd7b9..9ceda66a5 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -156,8 +156,9 @@ void EdgeBasedGraphFactory::Run() { //create Edge for NearestNeighborlookup edgeBasedEdges.push_back(newEdge); EdgeBasedNode currentNode; - currentNode.nameID = newEdge.data.nameID1; + if(_nodeBasedGraph->GetEdgeData(e1).type != 14) { + currentNode.nameID = newEdge.data.nameID1; currentNode.lat1 = inputNodeInfoList[u].lat; currentNode.lon1 = inputNodeInfoList[u].lon; currentNode.lat2 = inputNodeInfoList[v].lat; @@ -166,6 +167,7 @@ void EdgeBasedGraphFactory::Run() { edgeBasedNodes.push_back(currentNode); } if(_nodeBasedGraph->GetEdgeData(e2).type != 14) { + currentNode.nameID = newEdge.data.nameID2; currentNode.lat1 = inputNodeInfoList[v].lat; currentNode.lon1 = inputNodeInfoList[v].lon; currentNode.lat2 = inputNodeInfoList[w].lat; diff --git a/DataStructures/NNGrid.h b/DataStructures/NNGrid.h index b6ca55051..50824b7fb 100644 --- a/DataStructures/NNGrid.h +++ b/DataStructures/NNGrid.h @@ -198,7 +198,7 @@ public: int tlat = 100000*lat2y(edge.lat2/100000.); int tlon = edge.lon2; AddEdge( _GridEdge( - edge.id, + edge.id, edge.nameID, _Coordinate(slat, slon), _Coordinate(tlat, tlon) ) ); @@ -312,6 +312,7 @@ public: if(tmpDist < dist) { resultNode.isBidirected = false; resultNode.edgeBasedNode = candidate.edgeBasedNode; + resultNode.nodeBasedEdgeNameID = candidate.nameID; resultNode.ratio = r; dist = tmpDist; resultNode.location.lat = round(100000*(y2lat(static_cast(tmp.lat)/100000.))); diff --git a/DataStructures/PhantomNodes.h b/DataStructures/PhantomNodes.h index 7a6c0f9bb..5e1a656e8 100644 --- a/DataStructures/PhantomNodes.h +++ b/DataStructures/PhantomNodes.h @@ -24,9 +24,10 @@ or see http://www.gnu.org/licenses/agpl.txt. #include "ExtractorStructs.h" struct PhantomNode { - PhantomNode() : isBidirected(false), edgeBasedNode(UINT_MAX), ratio(1.) {} + PhantomNode() : isBidirected(false), edgeBasedNode(UINT_MAX), nodeBasedEdgeNameID(UINT_MAX), ratio(1.) {} bool isBidirected; NodeID edgeBasedNode; + unsigned nodeBasedEdgeNameID; double ratio; _Coordinate location; void Reset() {