NNGrid supports nameID of edges.
This commit is contained in:
parent
eca2c0c5ef
commit
caf8cd701e
@ -156,8 +156,9 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
//create Edge for NearestNeighborlookup
|
//create Edge for NearestNeighborlookup
|
||||||
edgeBasedEdges.push_back(newEdge);
|
edgeBasedEdges.push_back(newEdge);
|
||||||
EdgeBasedNode currentNode;
|
EdgeBasedNode currentNode;
|
||||||
currentNode.nameID = newEdge.data.nameID1;
|
|
||||||
if(_nodeBasedGraph->GetEdgeData(e1).type != 14) {
|
if(_nodeBasedGraph->GetEdgeData(e1).type != 14) {
|
||||||
|
currentNode.nameID = newEdge.data.nameID1;
|
||||||
currentNode.lat1 = inputNodeInfoList[u].lat;
|
currentNode.lat1 = inputNodeInfoList[u].lat;
|
||||||
currentNode.lon1 = inputNodeInfoList[u].lon;
|
currentNode.lon1 = inputNodeInfoList[u].lon;
|
||||||
currentNode.lat2 = inputNodeInfoList[v].lat;
|
currentNode.lat2 = inputNodeInfoList[v].lat;
|
||||||
@ -166,6 +167,7 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
edgeBasedNodes.push_back(currentNode);
|
edgeBasedNodes.push_back(currentNode);
|
||||||
}
|
}
|
||||||
if(_nodeBasedGraph->GetEdgeData(e2).type != 14) {
|
if(_nodeBasedGraph->GetEdgeData(e2).type != 14) {
|
||||||
|
currentNode.nameID = newEdge.data.nameID2;
|
||||||
currentNode.lat1 = inputNodeInfoList[v].lat;
|
currentNode.lat1 = inputNodeInfoList[v].lat;
|
||||||
currentNode.lon1 = inputNodeInfoList[v].lon;
|
currentNode.lon1 = inputNodeInfoList[v].lon;
|
||||||
currentNode.lat2 = inputNodeInfoList[w].lat;
|
currentNode.lat2 = inputNodeInfoList[w].lat;
|
||||||
|
@ -198,7 +198,7 @@ public:
|
|||||||
int tlat = 100000*lat2y(edge.lat2/100000.);
|
int tlat = 100000*lat2y(edge.lat2/100000.);
|
||||||
int tlon = edge.lon2;
|
int tlon = edge.lon2;
|
||||||
AddEdge( _GridEdge(
|
AddEdge( _GridEdge(
|
||||||
edge.id,
|
edge.id, edge.nameID,
|
||||||
_Coordinate(slat, slon),
|
_Coordinate(slat, slon),
|
||||||
_Coordinate(tlat, tlon) )
|
_Coordinate(tlat, tlon) )
|
||||||
);
|
);
|
||||||
@ -312,6 +312,7 @@ public:
|
|||||||
if(tmpDist < dist) {
|
if(tmpDist < dist) {
|
||||||
resultNode.isBidirected = false;
|
resultNode.isBidirected = false;
|
||||||
resultNode.edgeBasedNode = candidate.edgeBasedNode;
|
resultNode.edgeBasedNode = candidate.edgeBasedNode;
|
||||||
|
resultNode.nodeBasedEdgeNameID = candidate.nameID;
|
||||||
resultNode.ratio = r;
|
resultNode.ratio = r;
|
||||||
dist = tmpDist;
|
dist = tmpDist;
|
||||||
resultNode.location.lat = round(100000*(y2lat(static_cast<double>(tmp.lat)/100000.)));
|
resultNode.location.lat = round(100000*(y2lat(static_cast<double>(tmp.lat)/100000.)));
|
||||||
|
@ -24,9 +24,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include "ExtractorStructs.h"
|
#include "ExtractorStructs.h"
|
||||||
|
|
||||||
struct PhantomNode {
|
struct PhantomNode {
|
||||||
PhantomNode() : isBidirected(false), edgeBasedNode(UINT_MAX), ratio(1.) {}
|
PhantomNode() : isBidirected(false), edgeBasedNode(UINT_MAX), nodeBasedEdgeNameID(UINT_MAX), ratio(1.) {}
|
||||||
bool isBidirected;
|
bool isBidirected;
|
||||||
NodeID edgeBasedNode;
|
NodeID edgeBasedNode;
|
||||||
|
unsigned nodeBasedEdgeNameID;
|
||||||
double ratio;
|
double ratio;
|
||||||
_Coordinate location;
|
_Coordinate location;
|
||||||
void Reset() {
|
void Reset() {
|
||||||
|
Loading…
Reference in New Issue
Block a user