BREAKING CHANGE! Intermediate file format is not ASCII encoded anymore. Saves roughly 40 % space. Loading and saving is now much faster. Also, 50% I/Os less by writing the intermediate data non-linear. Please recompute all your data files.

This commit is contained in:
Dennis Luxen
2011-03-23 17:15:13 +00:00
parent 29977c4b88
commit 846bb11cc0
6 changed files with 148 additions and 76 deletions
+2
View File
@@ -60,6 +60,7 @@ public:
/** warning: caller needs to take care of synchronization! */
bool adressFunction(_Node n, HashTable<std::string, std::string> &keyVals) {
/*
std::string housenumber(keyVals.Find("addr:housenumber"));
std::string housename(keyVals.Find("addr:housename"));
std::string street(keyVals.Find("addr:street"));
@@ -73,6 +74,7 @@ public:
housenumber = housename;
addressVector->push_back(_Address(n, housenumber, street, state, country, postcode, city));
}
*/
return true;
}
+6 -9
View File
@@ -50,8 +50,8 @@ std::string names[14] = { "motorway", "motorway_link", "trunk", "trunk_link", "p
double speeds[14] = { 110, 90, 90, 70, 70, 60, 60, 50, 55, 25, 40 , 10, 30, 5};
struct _Node : NodeInfo{
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id), used(false) {}
_Node() : used(false) {}
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {}
_Node() {}
static _Node min_value() {
return _Node(0,0,0);
@@ -62,8 +62,6 @@ struct _Node : NodeInfo{
NodeID key() const {
return id;
}
bool used;
};
struct _Coordinate {
@@ -123,16 +121,15 @@ struct _Relation {
};
struct _Edge {
_Edge() : used(false) {};
_Edge(NodeID s, NodeID t) : start(s), target(t), used(false) { }
_Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), used(false) { }
_Edge() {};
_Edge(NodeID s, NodeID t) : start(s), target(t) { }
_Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp) { }
NodeID start;
NodeID target;
short type:15;
short type;
short direction;
double speed;
unsigned nameID;
bool used:1;
_Coordinate startCoord;
_Coordinate targetCoord;
+2
View File
@@ -93,8 +93,10 @@ public:
google::protobuf::ShutdownProtobufLibrary();
#ifdef DEBUG
std::cout << "[info] blocks: " << blockCount << std::endl;
std::cout << "[info] groups: " << groupCount << std::endl;
#endif
}
bool Init() {