Certain type of edges, i.e. ferries, are now properly ignored from
nearest neighbor lookup. Fixes ticket 59.
This commit is contained in:
parent
ad77d6cfec
commit
f5226b2228
@ -52,6 +52,7 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector<NodeBasedEdg
|
|||||||
assert( edge.data.distance > 0 );
|
assert( edge.data.distance > 0 );
|
||||||
edge.data.shortcut = false;
|
edge.data.shortcut = false;
|
||||||
edge.data.roundabout = i->isRoundabout();
|
edge.data.roundabout = i->isRoundabout();
|
||||||
|
edge.data.ignoreInGrid = i->ignoreInGrid();
|
||||||
edge.data.nameID = i->name();
|
edge.data.nameID = i->name();
|
||||||
edge.data.type = i->type();
|
edge.data.type = i->type();
|
||||||
edge.data.forward = i->isForward();
|
edge.data.forward = i->isForward();
|
||||||
@ -140,6 +141,7 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
currentNode.lat2 = inputNodeInfoList[v].lat;
|
currentNode.lat2 = inputNodeInfoList[v].lat;
|
||||||
currentNode.lon2 = inputNodeInfoList[v].lon;
|
currentNode.lon2 = inputNodeInfoList[v].lon;
|
||||||
currentNode.id = _nodeBasedGraph->GetEdgeData(e1).edgeBasedNodeID;
|
currentNode.id = _nodeBasedGraph->GetEdgeData(e1).edgeBasedNodeID;
|
||||||
|
currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid;
|
||||||
|
|
||||||
// short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
|
// short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
|
||||||
// short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
|
// short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
|
||||||
@ -205,7 +207,7 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
||||||
edgeBasedEdges.push_back(newEdge);
|
edgeBasedEdges.push_back(newEdge);
|
||||||
|
|
||||||
if(_nodeBasedGraph->GetEdgeData(e1).type != INT_MAX ) {
|
if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX ) {
|
||||||
EdgeBasedNode currentNode;
|
EdgeBasedNode currentNode;
|
||||||
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
||||||
currentNode.lat1 = inputNodeInfoList[u].lat;
|
currentNode.lat1 = inputNodeInfoList[u].lat;
|
||||||
@ -213,6 +215,8 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
currentNode.lat2 = inputNodeInfoList[v].lat;
|
currentNode.lat2 = inputNodeInfoList[v].lat;
|
||||||
currentNode.lon2 = inputNodeInfoList[v].lon;
|
currentNode.lon2 = inputNodeInfoList[v].lon;
|
||||||
currentNode.id = edgeBasedSource;
|
currentNode.id = edgeBasedSource;
|
||||||
|
currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid;
|
||||||
|
|
||||||
// short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
|
// short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
|
||||||
// short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
|
// short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
|
||||||
// short heightDiff = startHeight - targetHeight;
|
// short heightDiff = startHeight - targetHeight;
|
||||||
|
@ -41,11 +41,12 @@ private:
|
|||||||
struct _NodeBasedEdgeData {
|
struct _NodeBasedEdgeData {
|
||||||
int distance;
|
int distance;
|
||||||
unsigned edgeBasedNodeID;
|
unsigned edgeBasedNodeID;
|
||||||
unsigned nameID;
|
unsigned nameID:31;
|
||||||
bool shortcut:1;
|
bool shortcut:1;
|
||||||
bool forward:1;
|
bool forward:1;
|
||||||
bool backward:1;
|
bool backward:1;
|
||||||
bool roundabout:1;
|
bool roundabout:1;
|
||||||
|
bool ignoreInGrid:1;
|
||||||
short type;
|
short type;
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ public:
|
|||||||
NodeID id;
|
NodeID id;
|
||||||
NodeID nameID;
|
NodeID nameID;
|
||||||
unsigned weight;
|
unsigned weight;
|
||||||
|
bool ignoreInGrid;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -118,6 +118,18 @@ public:
|
|||||||
w.roundabout = true;
|
w.roundabout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Is the route tag listed as usable way in the profile?
|
||||||
|
if(settings[route] > 0 || settings[man_made] > 0) {
|
||||||
|
w.useful = true;
|
||||||
|
w.speed = settings[route];
|
||||||
|
w.direction = _Way::bidirectional;
|
||||||
|
if(0 < settings[route])
|
||||||
|
highway = route;
|
||||||
|
else if (0 < settings[man_made]) {
|
||||||
|
highway = man_made;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Is the highway tag listed as usable way?
|
//Is the highway tag listed as usable way?
|
||||||
if(0 < settings[highway] || "yes" == accessTag || "designated" == accessTag) {
|
if(0 < settings[highway] || "yes" == accessTag || "designated" == accessTag) {
|
||||||
|
|
||||||
@ -154,22 +166,14 @@ public:
|
|||||||
w.direction = _Way::opposite;
|
w.direction = _Way::opposite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//Is the route tag listed as usable way in the profile?
|
|
||||||
if(settings[route] > 0 || settings[man_made] > 0) {
|
|
||||||
w.useful = true;
|
|
||||||
w.speed = settings[route];
|
|
||||||
w.direction = _Way::bidirectional;
|
|
||||||
if(0 < settings[route])
|
|
||||||
highway = route;
|
|
||||||
else if (0 < settings[man_made]) {
|
|
||||||
highway = man_made;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( w.useful && w.access && (1 < w.path.size()) ) { //Only true if the way is specified by the speed profile
|
if ( w.useful && w.access && (1 < w.path.size()) ) { //Only true if the way is specified by the speed profile
|
||||||
//TODO: type is not set, perhaps use a bimap'ed speed profile to do set the type correctly?
|
//TODO: type is not set, perhaps use a bimap'ed speed profile to do set the type correctly?
|
||||||
w.type = settings.GetHighwayTypeID(highway);
|
w.type = settings.GetHighwayTypeID(highway);
|
||||||
|
if(0 > w.type) {
|
||||||
|
ERR("Resolved highway " << highway << " to " << w.type);
|
||||||
|
}
|
||||||
|
|
||||||
//Get the unique identifier for the street name
|
//Get the unique identifier for the street name
|
||||||
const StringMap::const_iterator strit = stringMap->find(w.name);
|
const StringMap::const_iterator strit = stringMap->find(w.name);
|
||||||
@ -195,7 +199,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(vector< NodeID >::size_type n = 0; n < w.path.size()-1; ++n) {
|
for(vector< NodeID >::size_type n = 0; n < w.path.size()-1; ++n) {
|
||||||
externalMemory->allEdges.push_back(_Edge(w.path[n], w.path[n+1], w.type, w.direction, w.speed, w.nameID, w.roundabout));
|
externalMemory->allEdges.push_back(_Edge(w.path[n], w.path[n+1], w.type, w.direction, w.speed, w.nameID, w.roundabout, highway == settings.excludeFromGrid));
|
||||||
externalMemory->usedNodeIDs.push_back(w.path[n]);
|
externalMemory->usedNodeIDs.push_back(w.path[n]);
|
||||||
}
|
}
|
||||||
externalMemory->usedNodeIDs.push_back(w.path[w.path.size()-1]);
|
externalMemory->usedNodeIDs.push_back(w.path[w.path.size()-1]);
|
||||||
|
@ -36,7 +36,7 @@ struct _PathData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::unordered_map<std::string, NodeID > StringMap;
|
typedef boost::unordered_map<std::string, NodeID > StringMap;
|
||||||
typedef boost::unordered_map<std::string, std::pair<int, int> > StringToIntPairMap;
|
typedef boost::unordered_map<std::string, std::pair<int, short> > StringToIntPairMap;
|
||||||
|
|
||||||
struct _Node : NodeInfo{
|
struct _Node : NodeInfo{
|
||||||
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {}
|
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {}
|
||||||
@ -134,10 +134,12 @@ struct _Relation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct _Edge {
|
struct _Edge {
|
||||||
_Edge() : start(0), target(0), type(0), direction(0), speed(0), nameID(0), isRoundabout(false) {};
|
_Edge() : start(0), target(0), type(0), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false) {};
|
||||||
_Edge(NodeID s, NodeID t) : start(s), target(t), type(0), direction(0), speed(0), nameID(0), isRoundabout(false) { }
|
_Edge(NodeID s, NodeID t) : start(s), target(t), type(0), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false) { }
|
||||||
_Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), nameID(0), isRoundabout(false) { }
|
_Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), nameID(0), isRoundabout(false), ignoreInGrid(false) { }
|
||||||
_Edge(NodeID s, NodeID t, short tp, short d, double sp, unsigned nid, bool isra): start(s), target(t), type(tp), direction(d), speed(sp), nameID(nid), isRoundabout(isra) { }
|
_Edge(NodeID s, NodeID t, short tp, short d, double sp, unsigned nid, bool isra, bool iing): start(s), target(t), type(tp), direction(d), speed(sp), nameID(nid), isRoundabout(isra), ignoreInGrid(iing) {
|
||||||
|
assert(0 <= type);
|
||||||
|
}
|
||||||
NodeID start;
|
NodeID start;
|
||||||
NodeID target;
|
NodeID target;
|
||||||
short type;
|
short type;
|
||||||
@ -145,6 +147,7 @@ struct _Edge {
|
|||||||
double speed;
|
double speed;
|
||||||
unsigned nameID;
|
unsigned nameID;
|
||||||
bool isRoundabout;
|
bool isRoundabout;
|
||||||
|
bool ignoreInGrid;
|
||||||
|
|
||||||
_Coordinate startCoord;
|
_Coordinate startCoord;
|
||||||
_Coordinate targetCoord;
|
_Coordinate targetCoord;
|
||||||
@ -265,10 +268,11 @@ struct Settings {
|
|||||||
}
|
}
|
||||||
int GetHighwayTypeID(const std::string & param) const {
|
int GetHighwayTypeID(const std::string & param) const {
|
||||||
if(param == excludeFromGrid) {
|
if(param == excludeFromGrid) {
|
||||||
return INT_MAX;
|
return SHRT_MAX;
|
||||||
}
|
}
|
||||||
|
assert(param != "ferry");
|
||||||
if(speedProfile.find(param) == speedProfile.end()) {
|
if(speedProfile.find(param) == speedProfile.end()) {
|
||||||
DEBUG("There is a bug with highway \"" << param << "\"");
|
ERR("There is a bug with highway \"" << param << "\"");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return speedProfile.at(param).second;
|
return speedProfile.at(param).second;
|
||||||
|
@ -42,10 +42,10 @@ public:
|
|||||||
|
|
||||||
/** Default constructor. target and weight are set to 0.*/
|
/** Default constructor. target and weight are set to 0.*/
|
||||||
NodeBasedEdge() :
|
NodeBasedEdge() :
|
||||||
_source(0), _target(0), _name(0), _weight(0), forward(0), backward(0), _type(0), _roundabout(false) { assert(false); } //shall not be used.
|
_source(0), _target(0), _name(0), _weight(0), forward(0), backward(0), _type(0), _roundabout(false), _ignoreInGrid(false) { assert(false); } //shall not be used.
|
||||||
|
|
||||||
explicit NodeBasedEdge(NodeID s, NodeID t, NodeID n, EdgeWeight w, bool f, bool b, short ty, bool ra) :
|
explicit NodeBasedEdge(NodeID s, NodeID t, NodeID n, EdgeWeight w, bool f, bool b, short ty, bool ra, bool ig) :
|
||||||
_source(s), _target(t), _name(n), _weight(w), forward(f), backward(b), _type(ty), _roundabout(ra) { assert(ty >= 0); }
|
_source(s), _target(t), _name(n), _weight(w), forward(f), backward(b), _type(ty), _roundabout(ra), _ignoreInGrid(ig) { if(ty < 0) {ERR("Type: " << ty);}; }
|
||||||
|
|
||||||
NodeID target() const {return _target; }
|
NodeID target() const {return _target; }
|
||||||
NodeID source() const {return _source; }
|
NodeID source() const {return _source; }
|
||||||
@ -57,6 +57,7 @@ public:
|
|||||||
bool isForward() const { return forward; }
|
bool isForward() const { return forward; }
|
||||||
bool isLocatable() const { return _type != 14; }
|
bool isLocatable() const { return _type != 14; }
|
||||||
bool isRoundabout() const { return _roundabout; }
|
bool isRoundabout() const { return _roundabout; }
|
||||||
|
bool ignoreInGrid() const { return _ignoreInGrid; }
|
||||||
|
|
||||||
NodeID _source;
|
NodeID _source;
|
||||||
NodeID _target;
|
NodeID _target;
|
||||||
@ -66,6 +67,7 @@ public:
|
|||||||
bool backward;
|
bool backward;
|
||||||
short _type;
|
short _type;
|
||||||
bool _roundabout;
|
bool _roundabout;
|
||||||
|
bool _ignoreInGrid;
|
||||||
};
|
};
|
||||||
|
|
||||||
class EdgeBasedEdge {
|
class EdgeBasedEdge {
|
||||||
|
@ -85,12 +85,13 @@ public:
|
|||||||
ramInFile.close();
|
ramInFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename EdgeT, typename NodeInfoT>
|
template<typename EdgeT>
|
||||||
void ConstructGrid(std::vector<EdgeT> & edgeList, std::vector<NodeInfoT> * int2ExtNodeMap, char * ramIndexOut, char * fileIndexOut) {
|
void ConstructGrid(std::vector<EdgeT> & edgeList, char * ramIndexOut, char * fileIndexOut) {
|
||||||
Percent p(edgeList.size());
|
Percent p(edgeList.size());
|
||||||
BOOST_FOREACH(EdgeT & edge, edgeList) {
|
BOOST_FOREACH(EdgeT & edge, edgeList) {
|
||||||
p.printIncrement();
|
p.printIncrement();
|
||||||
|
if(edge.ignoreInGrid)
|
||||||
|
continue;
|
||||||
int slat = 100000*lat2y(edge.lat1/100000.);
|
int slat = 100000*lat2y(edge.lat1/100000.);
|
||||||
int slon = edge.lon1;
|
int slon = edge.lon1;
|
||||||
int tlat = 100000*lat2y(edge.lat2/100000.);
|
int tlat = 100000*lat2y(edge.lat2/100000.);
|
||||||
|
@ -38,25 +38,24 @@ struct ObjectsForQueryStruct {
|
|||||||
QueryGraph * graph;
|
QueryGraph * graph;
|
||||||
|
|
||||||
ObjectsForQueryStruct(std::string hsgrPath, std::string ramIndexPath, std::string fileIndexPath, std::string nodesPath, std::string namesPath, std::string psd = "route") {
|
ObjectsForQueryStruct(std::string hsgrPath, std::string ramIndexPath, std::string fileIndexPath, std::string nodesPath, std::string namesPath, std::string psd = "route") {
|
||||||
std::cout << "[objects] loading query data structures ..." << std::flush;
|
INFO("loading graph data");
|
||||||
ifstream hsgrInStream(hsgrPath.c_str(), ios::binary);
|
std::ifstream hsgrInStream(hsgrPath.c_str(), ios::binary);
|
||||||
//Deserialize road network graph
|
//Deserialize road network graph
|
||||||
std::vector< QueryGraph::_StrNode> nodeList;
|
std::vector< QueryGraph::_StrNode> nodeList;
|
||||||
std::vector< QueryGraph::_StrEdge> edgeList;
|
std::vector< QueryGraph::_StrEdge> edgeList;
|
||||||
const int n = readHSGRFromStream(hsgrInStream, nodeList, edgeList);
|
const int n = readHSGRFromStream(hsgrInStream, nodeList, edgeList);
|
||||||
graph = new QueryGraph(nodeList, edgeList);
|
graph = new QueryGraph(nodeList, edgeList);
|
||||||
INFO("Graph has " << graph->GetNumberOfNodes() << " nodes");
|
assert(0 == nodeList.size());
|
||||||
INFO("Graph has " << graph->GetNumberOfEdges() << " edges");
|
assert(0 == edgeList.size());
|
||||||
|
INFO("Loading nearest neighbor indices");
|
||||||
|
|
||||||
|
|
||||||
//Init nearest neighbor data structure
|
//Init nearest neighbor data structure
|
||||||
ifstream nodesInStream(nodesPath.c_str(), ios::binary);
|
std::ifstream nodesInStream(nodesPath.c_str(), ios::binary);
|
||||||
nodeHelpDesk = new NodeInformationHelpDesk(ramIndexPath.c_str(), fileIndexPath.c_str(), n);
|
nodeHelpDesk = new NodeInformationHelpDesk(ramIndexPath.c_str(), fileIndexPath.c_str(), n);
|
||||||
nodeHelpDesk->initNNGrid(nodesInStream);
|
nodeHelpDesk->initNNGrid(nodesInStream);
|
||||||
|
|
||||||
//deserialize street name list
|
//deserialize street name list
|
||||||
ifstream namesInStream(namesPath.c_str(), ios::binary);
|
INFO("Loading names index");
|
||||||
|
std::ifstream namesInStream(namesPath.c_str(), ios::binary);
|
||||||
unsigned size(0);
|
unsigned size(0);
|
||||||
namesInStream.read((char *)&size, sizeof(unsigned));
|
namesInStream.read((char *)&size, sizeof(unsigned));
|
||||||
names = new std::vector<std::string>();
|
names = new std::vector<std::string>();
|
||||||
@ -72,7 +71,7 @@ struct ObjectsForQueryStruct {
|
|||||||
}
|
}
|
||||||
hsgrInStream.close();
|
hsgrInStream.close();
|
||||||
namesInStream.close();
|
namesInStream.close();
|
||||||
std::cout << "ok" << std::endl;
|
INFO("All query data structures loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
~ObjectsForQueryStruct() {
|
~ObjectsForQueryStruct() {
|
||||||
|
@ -142,7 +142,7 @@ NodeID readBinaryOSRMGraphFromStream(istream &in, vector<EdgeT>& edgeList, vecto
|
|||||||
short type;
|
short type;
|
||||||
NodeID nameID;
|
NodeID nameID;
|
||||||
int length;
|
int length;
|
||||||
bool isRoundabout;
|
bool isRoundabout, ignoreInGrid;
|
||||||
|
|
||||||
for (EdgeID i=0; i<m; ++i) {
|
for (EdgeID i=0; i<m; ++i) {
|
||||||
in.read((char*)&source, sizeof(unsigned));
|
in.read((char*)&source, sizeof(unsigned));
|
||||||
@ -153,6 +153,7 @@ NodeID readBinaryOSRMGraphFromStream(istream &in, vector<EdgeT>& edgeList, vecto
|
|||||||
in.read((char*)&type, sizeof(short));
|
in.read((char*)&type, sizeof(short));
|
||||||
in.read((char*)&nameID, sizeof(unsigned));
|
in.read((char*)&nameID, sizeof(unsigned));
|
||||||
in.read((char*)&isRoundabout, sizeof(bool));
|
in.read((char*)&isRoundabout, sizeof(bool));
|
||||||
|
in.read((char*)&ignoreInGrid, sizeof(bool));
|
||||||
|
|
||||||
GUARANTEE(length > 0, "loaded null length edge" );
|
GUARANTEE(length > 0, "loaded null length edge" );
|
||||||
GUARANTEE(weight > 0, "loaded null weight");
|
GUARANTEE(weight > 0, "loaded null weight");
|
||||||
@ -163,6 +164,8 @@ NodeID readBinaryOSRMGraphFromStream(istream &in, vector<EdgeT>& edgeList, vecto
|
|||||||
if (1 == dir) { backward = false; }
|
if (1 == dir) { backward = false; }
|
||||||
if (2 == dir) { forward = false; }
|
if (2 == dir) { forward = false; }
|
||||||
|
|
||||||
|
assert(type >= 0);
|
||||||
|
|
||||||
// translate the external NodeIDs to internal IDs
|
// translate the external NodeIDs to internal IDs
|
||||||
ExternalNodeMap::iterator intNodeID = ext2IntNodeMap.find(source);
|
ExternalNodeMap::iterator intNodeID = ext2IntNodeMap.find(source);
|
||||||
if( ext2IntNodeMap.find(source) == ext2IntNodeMap.end()) {
|
if( ext2IntNodeMap.find(source) == ext2IntNodeMap.end()) {
|
||||||
@ -182,7 +185,7 @@ NodeID readBinaryOSRMGraphFromStream(istream &in, vector<EdgeT>& edgeList, vecto
|
|||||||
target = intNodeID->second;
|
target = intNodeID->second;
|
||||||
GUARANTEE(source != UINT_MAX && target != UINT_MAX, "nonexisting source or target");
|
GUARANTEE(source != UINT_MAX && target != UINT_MAX, "nonexisting source or target");
|
||||||
|
|
||||||
EdgeT inputEdge(source, target, nameID, weight, forward, backward, type, isRoundabout );
|
EdgeT inputEdge(source, target, nameID, weight, forward, backward, type, isRoundabout, ignoreInGrid );
|
||||||
edgeList.push_back(inputEdge);
|
edgeList.push_back(inputEdge);
|
||||||
}
|
}
|
||||||
ext2IntNodeMap.clear();
|
ext2IntNodeMap.clear();
|
||||||
@ -358,7 +361,6 @@ template<typename NodeT, typename EdgeT>
|
|||||||
unsigned readHSGRFromStream(istream &in, vector<NodeT>& nodeList, vector<EdgeT> & edgeList) {
|
unsigned readHSGRFromStream(istream &in, vector<NodeT>& nodeList, vector<EdgeT> & edgeList) {
|
||||||
unsigned numberOfNodes = 0;
|
unsigned numberOfNodes = 0;
|
||||||
in.read((char*) & numberOfNodes, sizeof(unsigned));
|
in.read((char*) & numberOfNodes, sizeof(unsigned));
|
||||||
INFO("Loading " << numberOfNodes << " nodes");
|
|
||||||
nodeList.resize(numberOfNodes);
|
nodeList.resize(numberOfNodes);
|
||||||
NodeT currentNode;
|
NodeT currentNode;
|
||||||
for(unsigned nodeCounter = 0; nodeCounter < numberOfNodes; ++nodeCounter ) {
|
for(unsigned nodeCounter = 0; nodeCounter < numberOfNodes; ++nodeCounter ) {
|
||||||
@ -368,7 +370,6 @@ unsigned readHSGRFromStream(istream &in, vector<NodeT>& nodeList, vector<EdgeT>
|
|||||||
|
|
||||||
unsigned numberOfEdges = 0;
|
unsigned numberOfEdges = 0;
|
||||||
in.read((char*) &numberOfEdges, sizeof(unsigned));
|
in.read((char*) &numberOfEdges, sizeof(unsigned));
|
||||||
INFO("Loading " << numberOfEdges << " edges");
|
|
||||||
edgeList.resize(numberOfEdges);
|
edgeList.resize(numberOfEdges);
|
||||||
EdgeT currentEdge;
|
EdgeT currentEdge;
|
||||||
for(unsigned edgeCounter = 0; edgeCounter < numberOfEdges; ++edgeCounter) {
|
for(unsigned edgeCounter = 0; edgeCounter < numberOfEdges; ++edgeCounter) {
|
||||||
|
@ -126,7 +126,7 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
WritableGrid * writeableGrid = new WritableGrid();
|
WritableGrid * writeableGrid = new WritableGrid();
|
||||||
INFO("building grid ...");
|
INFO("building grid ...");
|
||||||
writeableGrid->ConstructGrid(nodeBasedEdgeList, &internalToExternaleNodeMapping, ramIndexOut, fileIndexOut);
|
writeableGrid->ConstructGrid(nodeBasedEdgeList, ramIndexOut, fileIndexOut);
|
||||||
DELETE( writeableGrid );
|
DELETE( writeableGrid );
|
||||||
nodeBasedEdgeList.clear();
|
nodeBasedEdgeList.clear();
|
||||||
std::vector<EdgeBasedGraphFactory::EdgeBasedNode>().swap(nodeBasedEdgeList);
|
std::vector<EdgeBasedGraphFactory::EdgeBasedNode>().swap(nodeBasedEdgeList);
|
||||||
|
@ -397,8 +397,6 @@ int main (int argc, char *argv[]) {
|
|||||||
double weight = ( distance * 10. ) / (edgeIT->speed / 3.6);
|
double weight = ( distance * 10. ) / (edgeIT->speed / 3.6);
|
||||||
int intWeight = max(1, (int) weight);
|
int intWeight = max(1, (int) weight);
|
||||||
int intDist = max(1, (int)distance);
|
int intDist = max(1, (int)distance);
|
||||||
int ferryIndex = settings["ferry"];
|
|
||||||
assert(ferryIndex != -1);
|
|
||||||
short zero = 0;
|
short zero = 0;
|
||||||
short one = 1;
|
short one = 1;
|
||||||
|
|
||||||
@ -429,6 +427,7 @@ int main (int argc, char *argv[]) {
|
|||||||
fout.write((char*)&edgeIT->type, sizeof(short));
|
fout.write((char*)&edgeIT->type, sizeof(short));
|
||||||
fout.write((char*)&edgeIT->nameID, sizeof(unsigned));
|
fout.write((char*)&edgeIT->nameID, sizeof(unsigned));
|
||||||
fout.write((char*)&edgeIT->isRoundabout, sizeof(bool));
|
fout.write((char*)&edgeIT->isRoundabout, sizeof(bool));
|
||||||
|
fout.write((char*)&edgeIT->ignoreInGrid, sizeof(bool));
|
||||||
}
|
}
|
||||||
++usedEdgeCounter;
|
++usedEdgeCounter;
|
||||||
++edgeIT;
|
++edgeIT;
|
||||||
|
Loading…
Reference in New Issue
Block a user