Skip to content

Commit

Permalink
fix oneway (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawlu authored Nov 12, 2024
1 parent c5dd327 commit 4975e01
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fstandalone-debug)
endif()

#include(cmake/StandardSettings.cmake)
#include(cmake/rootutils.cmake)
message("\nStarted CMake for ${PROJECT_NAME} v${PROJECT_VERSION}...\n")
Expand Down
6 changes: 4 additions & 2 deletions dev/osm2gmns_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ int main(int /*argc*/, char* /*argv*/[]) {
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);

// const auto map_folder = std::filesystem::path("maps/Texas");
const auto map_folder = std::filesystem::path("maps/Dallas");
// const auto map_folder = std::filesystem::path("maps/Dallas");
const auto map_folder = std::filesystem::path("maps/Columbus Ohio Data");

// const std::string map_filename = "map.osm.pbf";
// const std::string map_filename = "northwest-latest.osm.pbf";
const std::string map_filename = "map_sub.osm";
// const std::string map_filename = "map_sub.osm";
const std::string map_filename = "Columbus, Franklin County, Ohio, United States.pbf";

Network* network = getNetFromFile(map_folder / map_filename,
{ModeType::AUTO, ModeType::BIKE, ModeType::RAILWAY, ModeType::AEROWAY},
Expand Down
2 changes: 2 additions & 0 deletions src/osmnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ void OsmWay::configAttributes() {
if (!is_oneway_.has_value()) {
is_oneway_ = getDefaultOneWayFlag(highway_link_type_);
}
} else {
is_oneway_ = true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/osmnetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class OsmWay {
std::optional<int32_t> lanes_;
std::optional<int32_t> forward_lanes_;
std::optional<int32_t> backward_lanes_;
std::optional<bool> is_oneway_{true};
std::optional<bool> is_oneway_;
bool is_reversed_{false}; // ToDo: use when generating segments
std::optional<float> max_speed_;
std::string toll_;
Expand Down

0 comments on commit 4975e01

Please sign in to comment.