Skip to content

Commit 78ac475

Browse files
committed
Fix coordinates export
1 parent 351f2eb commit 78ac475

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
99

1010
# Ensure optimization flags are applied only in Release mode
1111
if (CMAKE_BUILD_TYPE MATCHES "Release")
12-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto")
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native -flto=auto")
1313
endif()
1414

1515
find_package(TBB REQUIRED CONFIG)

src/dsm/dsm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static constexpr uint8_t DSM_VERSION_MAJOR = 2;
88
static constexpr uint8_t DSM_VERSION_MINOR = 6;
9-
static constexpr uint8_t DSM_VERSION_PATCH = 0;
9+
static constexpr uint8_t DSM_VERSION_PATCH = 1;
1010

1111
static auto const DSM_VERSION =
1212
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);

src/dsm/sources/RoadNetwork.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ namespace dsm {
254254
// Check if the first line is nodeId;lat;lon
255255
std::string line;
256256
std::getline(ifs, line);
257-
if (line != "id;lon;lat;type") {
257+
if (line != "id;lat;lon;type") {
258258
throw std::invalid_argument(
259259
Logger::buildExceptionMessage("Invalid file format."));
260260
}
@@ -267,14 +267,14 @@ namespace dsm {
267267
std::istringstream iss{line};
268268
std::string nodeId, lat, lon, type;
269269
std::getline(iss, nodeId, ';');
270-
std::getline(iss, lon, ';');
271270
std::getline(iss, lat, ';');
271+
std::getline(iss, lon, ';');
272272
std::getline(iss, type, '\n');
273273
dLon = lon == "Nan" ? 0. : std::stod(lon);
274274
dLat = lat == "Nan" ? 0. : std::stod(lat);
275275
auto const& it{m_nodes.find(std::stoul(nodeId))};
276276
if (it != m_nodes.cend()) {
277-
it->second->setCoords(std::make_pair(dLon, dLat));
277+
it->second->setCoords(std::make_pair(dLat, dLon));
278278
if (type == "traffic_light" && !it->second->isTrafficLight()) {
279279
makeTrafficLight(it->first, 60);
280280
} else if (type == "roundabout" && !it->second->isRoundabout()) {
@@ -478,7 +478,7 @@ namespace dsm {
478478
path.substr(path.find_last_of(".")) == ".csv"));
479479
std::ofstream file{path};
480480
// Column names
481-
file << "id;lon;lat;type\n";
481+
file << "id;lat;lon;type\n";
482482
for (auto const& [nodeId, pNode] : m_nodes) {
483483
file << nodeId << ';';
484484
if (pNode->coords().has_value()) {

test/data/nodes.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id;lon;lat;type
1+
id;lat;lon;type
22
1;1;0;intersection
33
0;0;0;intersection
44
2;2;0;intersection

0 commit comments

Comments
 (0)