Reading restriction from input file produces packed vector with
size==capacity
This commit is contained in:
parent
0c0049f8cc
commit
3b01d785a5
@ -90,12 +90,10 @@ int main (int argc, char *argv[]) {
|
|||||||
_Restriction restriction;
|
_Restriction restriction;
|
||||||
unsigned usableRestrictionsCounter(0);
|
unsigned usableRestrictionsCounter(0);
|
||||||
restrictionsInstream.read((char*)&usableRestrictionsCounter, sizeof(unsigned));
|
restrictionsInstream.read((char*)&usableRestrictionsCounter, sizeof(unsigned));
|
||||||
for(unsigned i = 0; i < usableRestrictionsCounter; ++i) {
|
inputRestrictions.resize(usableRestrictionsCounter);
|
||||||
restrictionsInstream.read((char *)&(restriction), sizeof(_Restriction));
|
restrictionsInstream.read((char *)&(inputRestrictions[0]), usableRestrictionsCounter*sizeof(_Restriction));
|
||||||
inputRestrictions.push_back(restriction);
|
|
||||||
}
|
|
||||||
restrictionsInstream.close();
|
restrictionsInstream.close();
|
||||||
|
INFO("restrictions size: " << inputRestrictions.size() << ", capacity: " << inputRestrictions.capacity());
|
||||||
|
|
||||||
std::ifstream in;
|
std::ifstream in;
|
||||||
in.open (argv[1], std::ifstream::in | std::ifstream::binary);
|
in.open (argv[1], std::ifstream::in | std::ifstream::binary);
|
||||||
@ -112,6 +110,7 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
std::vector<ImportEdge> edgeList;
|
std::vector<ImportEdge> edgeList;
|
||||||
NodeID nodeBasedNodeNumber = readBinaryOSRMGraphFromStream(in, edgeList, bollardNodes, trafficLightNodes, &internalToExternalNodeMapping, inputRestrictions);
|
NodeID nodeBasedNodeNumber = readBinaryOSRMGraphFromStream(in, edgeList, bollardNodes, trafficLightNodes, &internalToExternalNodeMapping, inputRestrictions);
|
||||||
|
INFO("EdgeList size: " << edgeList.size() << ", edgeList.capacity: " << edgeList.capacity());
|
||||||
in.close();
|
in.close();
|
||||||
INFO("Loaded " << inputRestrictions.size() << " restrictions, " << bollardNodes.size() << " bollard nodes, " << trafficLightNodes.size() << " traffic lights");
|
INFO("Loaded " << inputRestrictions.size() << " restrictions, " << bollardNodes.size() << " bollard nodes, " << trafficLightNodes.size() << " traffic lights");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user