Skip to content

Commit

Permalink
Remove oneway col from output
Browse files Browse the repository at this point in the history
  • Loading branch information
Grufoony committed Jan 31, 2025
1 parent 7720d59 commit a197142
Show file tree
Hide file tree
Showing 11 changed files with 7,260 additions and 4,497 deletions.
2 changes: 1 addition & 1 deletion src/dsm/dsm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

static constexpr uint8_t DSM_VERSION_MAJOR = 2;
static constexpr uint8_t DSM_VERSION_MINOR = 3;
static constexpr uint8_t DSM_VERSION_PATCH = 17;
static constexpr uint8_t DSM_VERSION_PATCH = 18;

static auto const DSM_VERSION =
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);
Expand Down
5 changes: 2 additions & 3 deletions src/dsm/sources/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,11 @@ namespace dsm {
continue;
}
std::istringstream iss{line};
std::string sourceId, targetId, length, oneway, lanes, highway, maxspeed, name;
// u;v;length;oneway;highway;maxspeed;name
std::string sourceId, targetId, length, lanes, highway, maxspeed, name;
// u;v;length;highway;maxspeed;name
std::getline(iss, sourceId, ';');
std::getline(iss, targetId, ';');
std::getline(iss, length, ';');
std::getline(iss, oneway, ';');
std::getline(iss, lanes, ';');
std::getline(iss, highway, ';');
std::getline(iss, maxspeed, ';');
Expand Down
16 changes: 8 additions & 8 deletions test/Test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ TEST_CASE("Graph") {
GIVEN("A graph object") {
Graph graph{};
WHEN("We import nodes and edges from OSM") {
graph.importOSMNodes("./data/nodes.csv");
graph.importOSMEdges("./data/edges.csv");
std::ifstream fNodes{"./data/nodes.csv"};
graph.importOSMNodes("./data/postua_nodes.csv");
graph.importOSMEdges("./data/postua_edges.csv");
std::ifstream fNodes{"./data/postua_nodes.csv"};
// get number of lines
std::string line;
int nNodes{-1}; // -1 because of the header
while (std::getline(fNodes, line)) {
++nNodes;
}
fNodes.close();
std::ifstream fEdges{"./data/edges.csv"};
std::ifstream fEdges{"./data/postua_edges.csv"};
int nEdges{-1}; // -1 because of the header
while (std::getline(fEdges, line)) {
++nEdges;
Expand All @@ -222,17 +222,17 @@ TEST_CASE("Graph") {
}
}
WHEN("We import many nodes and edges from OSM") {
graph.importOSMNodes("./data/nodes_big.csv");
graph.importOSMEdges("./data/edges_big.csv");
std::ifstream fNodes{"./data/nodes_big.csv"};
graph.importOSMNodes("./data/forlì_nodes.csv");
graph.importOSMEdges("./data/forlì_edges.csv");
std::ifstream fNodes{"./data/forlì_nodes.csv"};
// get number of lines
std::string line;
int nNodes{-1}; // -1 because of the header
while (std::getline(fNodes, line)) {
++nNodes;
}
fNodes.close();
std::ifstream fEdges{"./data/edges_big.csv"};
std::ifstream fEdges{"./data/forlì_edges.csv"};
int nEdges{-1}; // -1 because of the header
while (std::getline(fEdges, line)) {
++nEdges;
Expand Down
61 changes: 0 additions & 61 deletions test/data/edges.csv

This file was deleted.

Loading

0 comments on commit a197142

Please sign in to comment.