NNGrid supports nameID of edges.

This commit is contained in:
DennisOSRM 2011-11-15 16:47:53 +01:00
parent eca2c0c5ef
commit caf8cd701e
3 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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<double>(tmp.lat)/100000.)));

View File

@ -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() {