diff --git a/dev/osm2gmns_dev.cpp b/dev/osm2gmns_dev.cpp index 766f247..5caa6aa 100644 --- a/dev/osm2gmns_dev.cpp +++ b/dev/osm2gmns_dev.cpp @@ -21,12 +21,13 @@ int main(int /*argc*/, char* /*argv*/[]) { absl::InitializeLog(); absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo); - // const auto map_folder = std::filesystem::path("dev/maps/District_of_Columbia"); + const auto map_folder = std::filesystem::path("dev/maps/District_of_Columbia"); // const auto map_folder = std::filesystem::path("dev/maps/gatech"); - const auto map_folder = std::filesystem::path("dev/maps/debug"); + // const auto map_folder = std::filesystem::path("dev/maps/Ile-de-France"); + // const auto map_folder = std::filesystem::path("dev/maps/debug"); - // const std::string map_filename = "map.osm.pbf"; - const std::string map_filename = "illinois-latest.osm.pbf"; + const std::string map_filename = "map.osm.pbf"; + // const std::string map_filename = "illinois-latest.osm.pbf"; // const std::string map_filename = "map.osm"; Network* network = getNetFromFile(map_folder / map_filename, {ModeType::AUTO}, @@ -36,7 +37,7 @@ int main(int /*argc*/, char* /*argv*/[]) { // consolidateComplexIntersections(network, true); - generateNodeActivityInfo(network); + // generateNodeActivityInfo(network); // fillLinkAttributesWithDefaultValues(network, true, {}, false, {{HighWayLinkType::MOTORWAY, 1}}, true, // {{HighWayLinkType::MOTORWAY, 1}}); diff --git a/src/constants.h b/src/constants.h index 25fffeb..ac65a5e 100644 --- a/src/constants.h +++ b/src/constants.h @@ -6,5 +6,6 @@ #define OSM2GMNS_CONSTANTS_H constexpr double MICROSECONDS_TO_SECOND = 1e-6; +constexpr float MPH_TO_KPH = 1.609; #endif // OSM2GMNS_CONSTANTS_H diff --git a/src/osmnetwork.cpp b/src/osmnetwork.cpp index d3bb021..2255c69 100644 --- a/src/osmnetwork.cpp +++ b/src/osmnetwork.cpp @@ -384,7 +384,8 @@ void OsmWay::configAttributes() { if (!max_speed_raw_.empty()) { std::smatch match; if (std::regex_search(max_speed_raw_, match, getFloatNumMatchingPattern())) { - max_speed_ = std::stof(match.str()); + max_speed_ = absl::StrContains(max_speed_raw_, "mph") ? std::round(std::stof(match.str()) * MPH_TO_KPH) + : std::stof(match.str()); } }