diff --git a/generator/maxspeed_builder.cpp b/generator/maxspeed_builder.cpp index abb5e17469..2192349b72 100644 --- a/generator/maxspeed_builder.cpp +++ b/generator/maxspeed_builder.cpp @@ -27,9 +27,6 @@ #include "defines.hpp" -// Important note. The code below in this file will be rewritten and covered by tests within the PR. -// Now it's written quickly to make a test map build this weekend. - using namespace feature; using namespace generator; using namespace routing; @@ -123,7 +120,7 @@ bool ParseMaxspeeds(string const & maxspeedFilename, OsmIdToMaxspeed & osmIdToMa if (!iter) // the line is empty return false; - // @TODO(bykoianko) trings::to_uint64 returns not-zero value if |*iter| is equal to + // @TODO(bykoianko) strings::to_uint64 returns not-zero value if |*iter| is equal to // a too long string of numbers. But ParseMaxspeeds() should return false in this case. uint64_t osmId = 0; if (!strings::to_uint64(*iter, osmId)) diff --git a/generator/maxspeed_builder.hpp b/generator/maxspeed_builder.hpp index 9b1f21418c..ed2dd409ac 100644 --- a/generator/maxspeed_builder.hpp +++ b/generator/maxspeed_builder.hpp @@ -18,7 +18,7 @@ using OsmIdToMaxspeed = std::map; /// \note There's a detailed description of the csv file in generator/maxspeed_collector.hpp. bool ParseMaxspeeds(std::string const & maxspeedFilename, OsmIdToMaxspeed & osmIdToMaxspeed); -/// \brief Write |speeds| to maxspeed section to mwm with |dataPath|. +/// \brief Writes |speeds| to maxspeed section to mwm with |dataPath|. void SerializeMaxspeed(std::string const & dataPath, std::vector && speeds); void BuildMaxspeed(std::string const & dataPath, diff --git a/routing/geometry.cpp b/routing/geometry.cpp index 38d2ba0439..1e89ca9142 100644 --- a/routing/geometry.cpp +++ b/routing/geometry.cpp @@ -156,7 +156,7 @@ void RoadGeometry::Load(VehicleModelInterface const & vehicleModel, FeatureType m_valid = vehicleModel.IsRoad(feature); m_isOneWay = vehicleModel.IsOneWay(feature); m_forwardSpeed = vehicleModel.GetSpeed(feature, {true /* forward */, inCity, maxspeed}); - m_backwardSpeed = vehicleModel.GetSpeed(feature, {true /* backward */, inCity, maxspeed}); + m_backwardSpeed = vehicleModel.GetSpeed(feature, {false /* forward */, inCity, maxspeed}); m_isPassThroughAllowed = vehicleModel.IsPassThroughAllowed(feature); m_junctions.clear(); diff --git a/routing/routing_tests/maxspeed_tests.cpp b/routing/routing_tests/maxspeed_tests.cpp index c330cfc075..74aa4b820d 100644 --- a/routing/routing_tests/maxspeed_tests.cpp +++ b/routing/routing_tests/maxspeed_tests.cpp @@ -154,4 +154,38 @@ UNIT_TEST(MaxspeedSerializer_BigImperial) }; TestMaxspeedSerialization(maxspeeds); } + +UNIT_TEST(Maxspeed) +{ + { + Maxspeed maxspeed; + TEST(!maxspeed.IsValid(), ()); + TEST(!maxspeed.IsBidirectional(), ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(true /* forward */), kInvalidSpeed, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(true /* forward */), kInvalidSpeed, ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(false /* forward */), kInvalidSpeed, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(false /* forward */), kInvalidSpeed, ()); + } + + { + Maxspeed maxspeed = {Units::Metric, 20 /* forward */, kInvalidSpeed /* backward */}; + TEST(maxspeed.IsValid(), ()); + TEST(!maxspeed.IsBidirectional(), ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(true /* forward */), 20, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(true /* forward */), 20, ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(false /* forward */), 20, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(false /* forward */), 20, ()); + } + + { + Maxspeed maxspeed = {Units::Metric, 30 /* forward */, 40 /* backward */}; + TEST(maxspeed.IsValid(), ()); + TEST(maxspeed.IsBidirectional(), ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(true /* forward */), 30, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(true /* forward */), 30, ()); + TEST_EQUAL(maxspeed.GetSpeedInUnits(false /* forward */), 40, ()); + TEST_EQUAL(maxspeed.GetSpeedKmPH(false /* forward */), 40, ()); + } + +} } // namespace diff --git a/routing_common/bicycle_model.cpp b/routing_common/bicycle_model.cpp index 96d7813650..e54b19149b 100644 --- a/routing_common/bicycle_model.cpp +++ b/routing_common/bicycle_model.cpp @@ -456,7 +456,7 @@ void BicycleModel::Init() m_bidirBicycleType = classif().GetTypeByPath({"hwtag", "bidir_bicycle"}); vector const additionalTags = { - {hwtagYesBicycle, m_maxSpeed}, + {hwtagYesBicycle, m_modelMaxSpeed}, {{"route", "ferry"}, kSpeedFerryKMpH}, {{"man_made", "pier"}, kSpeedPierKMpH} }; diff --git a/routing_common/maxspeed_conversion.cpp b/routing_common/maxspeed_conversion.cpp index 0677fbbf11..e504aa54c1 100644 --- a/routing_common/maxspeed_conversion.cpp +++ b/routing_common/maxspeed_conversion.cpp @@ -21,7 +21,38 @@ bool SpeedInUnits::operator<(SpeedInUnits const & rhs) const bool SpeedInUnits::IsNumeric() const { - return m_speed != kNoneMaxSpeed && m_speed != kWalkMaxSpeed && m_speed != kInvalidSpeed; + return routing::IsNumeric(m_speed); +} + +// Maxspeed ---------------------------------------------------------------------------------------- +bool Maxspeed::operator==(Maxspeed const & rhs) const +{ + return m_units == rhs.m_units && m_forward == rhs.m_forward && m_backward == rhs.m_backward; +} + +uint16_t Maxspeed::GetSpeedInUnits(bool forward) const +{ + return (forward || !IsBidirectional()) ? m_forward : m_backward; +} + +uint16_t Maxspeed::GetSpeedKmPH(bool forward) const +{ + auto speedInUnits = GetSpeedInUnits(forward); + if (speedInUnits == kInvalidSpeed) + return kInvalidSpeed; // That means IsValid() returns false. + + if (IsNumeric(speedInUnits)) + return ToSpeedKmPH(speedInUnits, m_units); + + // A feature is marked as a feature without any speed limits. (maxspeed=="none"). + if (kNoneMaxSpeed) + return 1000; // km per hour + + // A feature is marked the a driver should drive with walking speed on it. (maxspeed=="walk"). + if (kWalkMaxSpeed) + return 6; // km per hour + + CHECK(false, ("Method IsNumeric() returns something wrong.")); } // FeatureMaxspeed --------------------------------------------------------------------------------- @@ -243,6 +274,11 @@ bool HaveSameUnits(SpeedInUnits const & lhs, SpeedInUnits const & rhs) return lhs.m_units == rhs.m_units || !lhs.IsNumeric() || !rhs.IsNumeric(); } +bool IsNumeric(uint16_t speed) +{ + return speed != kNoneMaxSpeed && speed != kWalkMaxSpeed && speed != kInvalidSpeed; +} + std::string DebugPrint(Maxspeed maxspeed) { std::ostringstream oss; diff --git a/routing_common/maxspeed_conversion.hpp b/routing_common/maxspeed_conversion.hpp index f855096600..0883b057b8 100644 --- a/routing_common/maxspeed_conversion.hpp +++ b/routing_common/maxspeed_conversion.hpp @@ -183,16 +183,26 @@ struct Maxspeed measurement_utils::Units m_units = measurement_utils::Units::Metric; // Speed in km per hour or mile per hour depends on |m_units|. uint16_t m_forward = kInvalidSpeed; - // Speed in km per hour or mile per hour depends on |m_units|. + // Speed in km per hour or mile per hour depends on |m_units|. If |m_backward| == kInvalidSpeed + // |m_forward| speed should be used for the both directions. uint16_t m_backward = kInvalidSpeed; - bool operator==(Maxspeed const & rhs) const - { - return m_units == rhs.m_units && m_forward == rhs.m_forward && m_backward == rhs.m_backward; - } + bool operator==(Maxspeed const & rhs) const; bool IsValid() const { return m_forward != kInvalidSpeed; } + /// \returns true if Maxspeed is considered as Bidirectional(). It means different + /// speed is set for forward and backward direction. Otherwise returns false. It means + /// |m_forward| speed should be used for the both directions. bool IsBidirectional() const { return IsValid() && m_backward != kInvalidSpeed; } + + /// \brief returns speed according to |m_units|. |kInvalidSpeed|, |kNoneMaxSpeed| or + /// |kWalkMaxSpeed| may be returned. + uint16_t GetSpeedInUnits(bool forward) const; + + /// \brief returns speed in km per hour. If it's not valid |kInvalidSpeed| is + /// returned. Otherwise forward or backward speed in km per hour is returned. |kNoneMaxSpeed| and + /// |kWalkMaxSpeed| are converted to some numbers. + uint16_t GetSpeedKmPH(bool forward) const; }; /// \brief Feature id and corresponding maxspeed tag value. |m_forward| and |m_backward| fields @@ -246,6 +256,11 @@ private: MaxspeedConverter const & GetMaxspeedConverter(); bool HaveSameUnits(SpeedInUnits const & lhs, SpeedInUnits const & rhs); +/// \returns false if |speed| is equal to |kInvalidSpeed|, |kNoneMaxSpeed| or +/// |kWalkMaxSpeed|. +/// \param speed in km per hour or mile per hour. +bool IsNumeric(uint16_t speed); + std::string DebugPrint(Maxspeed maxspeed); std::string DebugPrint(SpeedMacro maxspeed); std::string DebugPrint(SpeedInUnits const & speed); diff --git a/routing_common/pedestrian_model.cpp b/routing_common/pedestrian_model.cpp index c8fa6a3ebe..f9f652b637 100644 --- a/routing_common/pedestrian_model.cpp +++ b/routing_common/pedestrian_model.cpp @@ -308,7 +308,7 @@ void PedestrianModel::Init() m_yesFootType = classif().GetTypeByPath(hwtagYesFoot); vector const additionalTags = { - {hwtagYesFoot, m_maxSpeed}, + {hwtagYesFoot, m_modelMaxSpeed}, {{"route", "ferry"}, kSpeedFerryKMpH}, {{"man_made", "pier"}, kSpeedPierKMpH} }; diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp index 9dc4292a76..3008499b6d 100644 --- a/routing_common/vehicle_model.cpp +++ b/routing_common/vehicle_model.cpp @@ -49,7 +49,7 @@ VehicleModel::RoadLimits::RoadLimits(VehicleModel::InOutCitySpeedKMpH const & sp VehicleModel::VehicleModel(Classificator const & c, LimitsInitList const & featureTypeLimits, SurfaceInitList const & featureTypeSurface) - : m_maxSpeed({}, {}), m_onewayType(c.GetTypeByPath({"hwtag", "oneway"})) + : m_modelMaxSpeed({}, {}), m_onewayType(c.GetTypeByPath({"hwtag", "oneway"})) { CHECK_EQUAL(m_surfaceFactors.size(), 4, ("If you want to change the size of the container please take into account that it's " @@ -58,7 +58,7 @@ VehicleModel::VehicleModel(Classificator const & c, LimitsInitList const & featu for (auto const & v : featureTypeLimits) { - m_maxSpeed = Max(m_maxSpeed, v.m_speed); + m_modelMaxSpeed = Max(m_modelMaxSpeed, v.m_speed); m_highwayTypes.emplace(c.GetTypeByPath(v.m_types), RoadLimits(v.m_speed, v.m_isPassThroughAllowed)); } @@ -83,7 +83,7 @@ void VehicleModel::SetAdditionalRoadTypes(Classificator const & c, for (auto const & tag : additionalTags) { m_addRoadTypes.emplace_back(c, tag); - m_maxSpeed = Max(m_maxSpeed, tag.m_speed); + m_modelMaxSpeed = Max(m_modelMaxSpeed, tag.m_speed); } } @@ -94,22 +94,32 @@ VehicleModel::SpeedKMpH VehicleModel::GetSpeed(FeatureType & f, SpeedParams cons RoadAvailability const restriction = GetRoadAvailability(types); // @TODO(bykoianko) Consider using speed on feature |f| instead of using max speed below. if (restriction == RoadAvailability::Available) - return speedParams.m_inCity ? m_maxSpeed.m_inCity : m_maxSpeed.m_outCity; + return speedParams.m_inCity ? m_modelMaxSpeed.m_inCity : m_modelMaxSpeed.m_outCity; + if (restriction != RoadAvailability::NotAvailable && HasRoadType(types)) - return GetMinTypeSpeed(types, speedParams.m_inCity); + { + uint16_t const speedKmPH = speedParams.m_maxspeed.GetSpeedKmPH(speedParams.m_forward); + // Note. It's the first rough attept using maxspeed tag value for speed calculation. + // It's used as a feature speed if it's valid and less then some value. + // @TODO maxspeed tag value should be used more sophisticated. + if (!speedParams.m_maxspeed.IsValid() || speedKmPH > 200) + return GetMinTypeSpeed(types, speedParams.m_inCity); + + return {static_cast(speedKmPH), static_cast(speedKmPH)}; + } return {}; } double VehicleModel::GetMaxWeightSpeed() const { - return max(m_maxSpeed.m_inCity.m_weight, m_maxSpeed.m_outCity.m_weight); + return max(m_modelMaxSpeed.m_inCity.m_weight, m_modelMaxSpeed.m_outCity.m_weight); } VehicleModel::SpeedKMpH VehicleModel::GetMinTypeSpeed(feature::TypesHolder const & types, bool inCity) const { - double const maxSpeedWeight = inCity ? m_maxSpeed.m_inCity.m_weight : m_maxSpeed.m_outCity.m_weight; - double const maxEtaWeight = inCity ? m_maxSpeed.m_inCity.m_eta : m_maxSpeed.m_outCity.m_eta; + double const maxSpeedWeight = inCity ? m_modelMaxSpeed.m_inCity.m_weight : m_modelMaxSpeed.m_outCity.m_weight; + double const maxEtaWeight = inCity ? m_modelMaxSpeed.m_inCity.m_eta : m_modelMaxSpeed.m_outCity.m_eta; VehicleModel::SpeedKMpH speed{maxSpeedWeight * 2.0, maxEtaWeight * 2.0}; // Decreasing speed factor based on road surface (cover). VehicleModel::SpeedFactor factor; diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp index 30fa221daf..1995b7ba83 100644 --- a/routing_common/vehicle_model.hpp +++ b/routing_common/vehicle_model.hpp @@ -218,7 +218,9 @@ protected: SpeedKMpH GetMinTypeSpeed(feature::TypesHolder const & types, bool inCity) const; - InOutCitySpeedKMpH m_maxSpeed; + /// \brief maximum within all the speed limits set in a model (car model, bicycle modle and so on). + /// It shouldn't be mixed with maxspeed value tag which defines maximum legal speed on a feature. + InOutCitySpeedKMpH m_modelMaxSpeed; private: struct AdditionalRoadType final diff --git a/xcode/generator/generator.xcodeproj/project.pbxproj b/xcode/generator/generator.xcodeproj/project.pbxproj index d034b811c9..c469e3c243 100644 --- a/xcode/generator/generator.xcodeproj/project.pbxproj +++ b/xcode/generator/generator.xcodeproj/project.pbxproj @@ -69,6 +69,12 @@ 5631B64F219B0C6D009F47D4 /* geo_objects.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B64D219B0C6D009F47D4 /* geo_objects.hpp */; }; 5631B650219B0C6D009F47D4 /* geo_objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B64E219B0C6D009F47D4 /* geo_objects.cpp */; }; 5631B652219B0C82009F47D4 /* extract_addr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B651219B0C82009F47D4 /* extract_addr.cpp */; }; + 5631B659219B0F14009F47D4 /* maxspeed_builder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B653219B0F14009F47D4 /* maxspeed_builder.hpp */; }; + 5631B65A219B0F14009F47D4 /* maxspeed_collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B654219B0F14009F47D4 /* maxspeed_collector.cpp */; }; + 5631B65B219B0F14009F47D4 /* maxspeed_collector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B655219B0F14009F47D4 /* maxspeed_collector.hpp */; }; + 5631B65C219B0F14009F47D4 /* maxspeed_parser.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B656219B0F14009F47D4 /* maxspeed_parser.hpp */; }; + 5631B65D219B0F14009F47D4 /* maxspeed_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B657219B0F14009F47D4 /* maxspeed_parser.cpp */; }; + 5631B65E219B0F14009F47D4 /* maxspeed_builder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B658219B0F14009F47D4 /* maxspeed_builder.cpp */; }; 56829A462134222300A09A28 /* city_roads_generator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56829A422134222100A09A28 /* city_roads_generator.hpp */; }; 56829A482134222300A09A28 /* city_roads_generator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56829A442134222300A09A28 /* city_roads_generator.cpp */; }; 568762601F6A9B18002C22A6 /* transit_generator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5687625E1F6A9B18002C22A6 /* transit_generator.cpp */; }; @@ -265,6 +271,12 @@ 5631B64D219B0C6D009F47D4 /* geo_objects.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = geo_objects.hpp; path = geo_objects/geo_objects.hpp; sourceTree = ""; }; 5631B64E219B0C6D009F47D4 /* geo_objects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = geo_objects.cpp; path = geo_objects/geo_objects.cpp; sourceTree = ""; }; 5631B651219B0C82009F47D4 /* extract_addr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = extract_addr.cpp; path = extract_addr/extract_addr.cpp; sourceTree = ""; }; + 5631B653219B0F14009F47D4 /* maxspeed_builder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeed_builder.hpp; sourceTree = ""; }; + 5631B654219B0F14009F47D4 /* maxspeed_collector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_collector.cpp; sourceTree = ""; }; + 5631B655219B0F14009F47D4 /* maxspeed_collector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeed_collector.hpp; sourceTree = ""; }; + 5631B656219B0F14009F47D4 /* maxspeed_parser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeed_parser.hpp; sourceTree = ""; }; + 5631B657219B0F14009F47D4 /* maxspeed_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_parser.cpp; sourceTree = ""; }; + 5631B658219B0F14009F47D4 /* maxspeed_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_builder.cpp; sourceTree = ""; }; 56829A422134222100A09A28 /* city_roads_generator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = city_roads_generator.hpp; sourceTree = ""; }; 56829A442134222300A09A28 /* city_roads_generator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = city_roads_generator.cpp; sourceTree = ""; }; 5687625E1F6A9B18002C22A6 /* transit_generator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = transit_generator.cpp; sourceTree = ""; }; @@ -453,6 +465,12 @@ 6753401D1A3F2A1B00A0A8C3 /* generator */ = { isa = PBXGroup; children = ( + 5631B658219B0F14009F47D4 /* maxspeed_builder.cpp */, + 5631B653219B0F14009F47D4 /* maxspeed_builder.hpp */, + 5631B654219B0F14009F47D4 /* maxspeed_collector.cpp */, + 5631B655219B0F14009F47D4 /* maxspeed_collector.hpp */, + 5631B657219B0F14009F47D4 /* maxspeed_parser.cpp */, + 5631B656219B0F14009F47D4 /* maxspeed_parser.hpp */, 5631B651219B0C82009F47D4 /* extract_addr.cpp */, 5631B64E219B0C6D009F47D4 /* geo_objects.cpp */, 5631B64D219B0C6D009F47D4 /* geo_objects.hpp */, @@ -676,6 +694,8 @@ 40492BCA2021DC53008E093A /* feature_helpers.hpp in Headers */, 56FB43872164F571002099B3 /* regions_builder.hpp in Headers */, 675340781A3F2A7400A0A8C3 /* intermediate_elements.hpp in Headers */, + 5631B65B219B0F14009F47D4 /* maxspeed_collector.hpp in Headers */, + 5631B659219B0F14009F47D4 /* maxspeed_builder.hpp in Headers */, 3DFEBF7E1EF2D58900317D5C /* utils.hpp in Headers */, 39B2B9791FB468CC00AB85A1 /* cities_boundaries_builder.hpp in Headers */, 6753408C1A3F2A7400A0A8C3 /* world_map_generator.hpp in Headers */, @@ -738,6 +758,7 @@ 675340611A3F2A7400A0A8C3 /* check_model.hpp in Headers */, 6726C1D61A4AFEF4005EEA39 /* osm2meta.hpp in Headers */, 34F5588D1DBF4C9600A4FC11 /* sponsored_scoring.hpp in Headers */, + 5631B65C219B0F14009F47D4 /* maxspeed_parser.hpp in Headers */, 4003E3B92112FB2B007721B0 /* place.hpp in Headers */, 4003E3B22112FB2B007721B0 /* emitter_interface.hpp in Headers */, 4003E3AA2112FB2B007721B0 /* factory_utils.hpp in Headers */, @@ -860,6 +881,8 @@ 670B84BC1A8CDB0000CE4492 /* osm_source.cpp in Sources */, 675340701A3F2A7400A0A8C3 /* feature_sorter.cpp in Sources */, 675340621A3F2A7400A0A8C3 /* coastlines_generator.cpp in Sources */, + 5631B65E219B0F14009F47D4 /* maxspeed_builder.cpp in Sources */, + 5631B65A219B0F14009F47D4 /* maxspeed_collector.cpp in Sources */, 56037E4F219AF97200C2193D /* emitter_simple.cpp in Sources */, 670E7BC11EF983E600A8E9ED /* region_meta.cpp in Sources */, E162BD4A213EAF0A007ADEF1 /* place.cpp in Sources */, @@ -867,6 +890,7 @@ 675340931C5231BA002CF0D9 /* search_index_builder.cpp in Sources */, 6753406E1A3F2A7400A0A8C3 /* feature_merger.cpp in Sources */, E1EC1461211C5FBD00B53061 /* relation_tags.cpp in Sources */, + 5631B65D219B0F14009F47D4 /* maxspeed_parser.cpp in Sources */, 56A6C3DA219B0BDA00A52855 /* collector_region_info.cpp in Sources */, 34F5587B1DBF4C8300A4FC11 /* feature_segments_checker.cpp in Sources */, 67C79BB31E2CEEAB00C40034 /* restriction_writer.cpp in Sources */, diff --git a/xcode/generator_tool/generator_tool.xcodeproj/project.pbxproj b/xcode/generator_tool/generator_tool.xcodeproj/project.pbxproj index 1b846c4433..7e2c4f5b1a 100644 --- a/xcode/generator_tool/generator_tool.xcodeproj/project.pbxproj +++ b/xcode/generator_tool/generator_tool.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ 562147291F6AA37E002D2214 /* libmwm_diff.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 562147281F6AA37E002D2214 /* libmwm_diff.a */; }; 562D42941FD8460500A995F3 /* libugc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 562D42951FD8460500A995F3 /* libugc.a */; }; 562D42961FD8463700A995F3 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 670E7BC61EF992F600A8E9ED /* libsqlite3.tbd */; }; + 5631B660219B0F41009F47D4 /* maxspeed_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B65F219B0F41009F47D4 /* maxspeed_tests.cpp */; }; 56829A4C2134238800A09A28 /* cities_boundaries_checker_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56829A4A2134238700A09A28 /* cities_boundaries_checker_tests.cpp */; }; 56829A4D2134238800A09A28 /* city_roads_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56829A4B2134238800A09A28 /* city_roads_tests.cpp */; }; 56A6C3D2219AFDEE00A52855 /* filter_elements_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56A6C3CD219AFDED00A52855 /* filter_elements_tests.cpp */; }; @@ -223,6 +224,7 @@ 562147261F6AA36A002D2214 /* libbsdiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbsdiff.a; path = ../bsdiff/build/Debug/libbsdiff.a; sourceTree = ""; }; 562147281F6AA37E002D2214 /* libmwm_diff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmwm_diff.a; path = "../../../../Library/Developer/Xcode/DerivedData/omim-gsfdicnjgjjbizhdmwedavcucpok/Build/Products/Debug/libmwm_diff.a"; sourceTree = ""; }; 562D42951FD8460500A995F3 /* libugc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libugc.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 5631B65F219B0F41009F47D4 /* maxspeed_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_tests.cpp; sourceTree = ""; }; 56829A4A2134238700A09A28 /* cities_boundaries_checker_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cities_boundaries_checker_tests.cpp; sourceTree = ""; }; 56829A4B2134238800A09A28 /* city_roads_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = city_roads_tests.cpp; sourceTree = ""; }; 56A6C3CD219AFDED00A52855 /* filter_elements_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_elements_tests.cpp; sourceTree = ""; }; @@ -230,7 +232,7 @@ 56A6C3CF219AFDEE00A52855 /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = ""; }; 56A6C3D0219AFDEE00A52855 /* regions_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = regions_tests.cpp; sourceTree = ""; }; 56A6C3D1219AFDEE00A52855 /* region_info_collector_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = region_info_collector_tests.cpp; sourceTree = ""; }; - 56A6C3D6219AFE2300A52855 /* generator_tests */ = {isa = PBXFileReference; lastKnownFileType = folder; name = generator_tests; sourceTree = ""; }; + 56A6C3D6219AFE2300A52855 /* generator_tests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = generator_tests; sourceTree = ""; }; 56EE14CE1FE803EA0036F20C /* libtransit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libtransit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 56EE14D01FE803FE0036F20C /* libtransit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libtransit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 670E7BBB1EF9832200A8E9ED /* libicu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicu.a; path = "../../../../Library/Developer/Xcode/DerivedData/omim-gzleizqujktwggdwiejzkgjrsgvp/Build/Products/Debug/libicu.a"; sourceTree = ""; }; @@ -499,6 +501,7 @@ 6726C1D71A4C27A5005EEA39 /* generator_tests */ = { isa = PBXGroup; children = ( + 5631B65F219B0F41009F47D4 /* maxspeed_tests.cpp */, 56A6C3D6219AFE2300A52855 /* generator_tests */, 56A6C3CF219AFDEE00A52855 /* common.cpp */, 56A6C3CE219AFDED00A52855 /* common.hpp */, @@ -748,6 +751,7 @@ 67AB92D01B75156400AB5194 /* coasts_test.cpp in Sources */, 670F291B1BA6CE4F00F2ABF4 /* check_mwms.cpp in Sources */, 67AB92D91B75158300AB5194 /* osm_o5m_source_test.cpp in Sources */, + 5631B660219B0F41009F47D4 /* maxspeed_tests.cpp in Sources */, 56829A4D2134238800A09A28 /* city_roads_tests.cpp in Sources */, 56A6C3D3219AFDEE00A52855 /* common.cpp in Sources */, 56A6C3D5219AFDEE00A52855 /* region_info_collector_tests.cpp in Sources */, diff --git a/xcode/routing/routing.xcodeproj/project.pbxproj b/xcode/routing/routing.xcodeproj/project.pbxproj index fb070f0cf4..0388ffb661 100644 --- a/xcode/routing/routing.xcodeproj/project.pbxproj +++ b/xcode/routing/routing.xcodeproj/project.pbxproj @@ -92,6 +92,11 @@ 56290B87206A3232003892E0 /* routing_algorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56290B85206A3231003892E0 /* routing_algorithm.cpp */; }; 56290B88206A3232003892E0 /* routing_algorithm.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56290B86206A3231003892E0 /* routing_algorithm.hpp */; }; 562BDE2020D14860008EFF6F /* routing_callbacks.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 562BDE1F20D14860008EFF6F /* routing_callbacks.hpp */; }; + 5631B662219B0F66009F47D4 /* maxspeed_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B661219B0F66009F47D4 /* maxspeed_tests.cpp */; }; + 5631B66B219B125D009F47D4 /* maxspeeds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B667219B125C009F47D4 /* maxspeeds.cpp */; }; + 5631B66C219B125D009F47D4 /* maxspeeds.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B668219B125C009F47D4 /* maxspeeds.hpp */; }; + 5631B66D219B125D009F47D4 /* maxspeed_serialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B669219B125C009F47D4 /* maxspeed_serialization.cpp */; }; + 5631B66E219B125D009F47D4 /* maxspeed_serialization.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B66A219B125D009F47D4 /* maxspeed_serialization.hpp */; }; 56473D74214825B6007E6FBA /* city_roads_serialization.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56473D72214825B4007E6FBA /* city_roads_serialization.hpp */; }; 56555E561D897C90009D786D /* libalohalitics.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6742ACE61C68A23B009CB89E /* libalohalitics.a */; }; 56555E581D897C9D009D786D /* liboauthcpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6742ACFA1C68A2D7009CB89E /* liboauthcpp.a */; }; @@ -376,6 +381,11 @@ 56290B85206A3231003892E0 /* routing_algorithm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = routing_algorithm.cpp; sourceTree = ""; }; 56290B86206A3231003892E0 /* routing_algorithm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = routing_algorithm.hpp; sourceTree = ""; }; 562BDE1F20D14860008EFF6F /* routing_callbacks.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = routing_callbacks.hpp; sourceTree = ""; }; + 5631B661219B0F66009F47D4 /* maxspeed_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_tests.cpp; sourceTree = ""; }; + 5631B667219B125C009F47D4 /* maxspeeds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeeds.cpp; sourceTree = ""; }; + 5631B668219B125C009F47D4 /* maxspeeds.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeeds.hpp; sourceTree = ""; }; + 5631B669219B125C009F47D4 /* maxspeed_serialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_serialization.cpp; sourceTree = ""; }; + 5631B66A219B125D009F47D4 /* maxspeed_serialization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeed_serialization.hpp; sourceTree = ""; }; 56473D72214825B4007E6FBA /* city_roads_serialization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = city_roads_serialization.hpp; sourceTree = ""; }; 5661A5CD20DE51C500C6B1D1 /* tools.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tools.hpp; sourceTree = ""; }; 567059591F3AF96D0062672D /* checkpoint_predictor_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = checkpoint_predictor_test.cpp; sourceTree = ""; }; @@ -658,6 +668,7 @@ 6742ACA01C68A07C009CB89E /* routing_tests */ = { isa = PBXGroup; children = ( + 5631B661219B0F66009F47D4 /* maxspeed_tests.cpp */, 44F45B272136B069001B1618 /* speed_cameras_tests.cpp */, 5661A5CD20DE51C500C6B1D1 /* tools.hpp */, 56290B85206A3231003892E0 /* routing_algorithm.cpp */, @@ -791,6 +802,10 @@ 675343FA1A3F640D00A0A8C3 /* routing */ = { isa = PBXGroup; children = ( + 5631B669219B125C009F47D4 /* maxspeed_serialization.cpp */, + 5631B66A219B125D009F47D4 /* maxspeed_serialization.hpp */, + 5631B667219B125C009F47D4 /* maxspeeds.cpp */, + 5631B668219B125C009F47D4 /* maxspeeds.hpp */, 44AE4A10214FBB8D006321F5 /* speed_camera.cpp */, 44AE4A11214FBB8D006321F5 /* speed_camera.hpp */, 56473D72214825B4007E6FBA /* city_roads_serialization.hpp */, @@ -950,6 +965,7 @@ 67C79BA21E2CEE1400C40034 /* restriction_loader.hpp in Headers */, 674F9BCB1B0A580E00704FFA /* async_router.hpp in Headers */, 0C08AA391DF8329B004195DD /* routing_exceptions.hpp in Headers */, + 5631B66E219B125D009F47D4 /* maxspeed_serialization.hpp in Headers */, 0C5BC9D21E28FD4E0071BFDD /* index_road_graph.hpp in Headers */, 674F9BD11B0A580E00704FFA /* online_cross_fetcher.hpp in Headers */, 0C470E701E0D4EB1005B824D /* segment.hpp in Headers */, @@ -965,6 +981,7 @@ 40BEC0811F99FFD700E06CA4 /* transit_info.hpp in Headers */, 4065EA861F8260010094DEF3 /* transit_graph_loader.hpp in Headers */, 6741AA9D1BF35331002C974C /* turns_notification_manager.hpp in Headers */, + 5631B66C219B125D009F47D4 /* maxspeeds.hpp in Headers */, 674F9BD71B0A580E00704FFA /* turns_generator.hpp in Headers */, 40655E741F8BA46B0065305E /* fake_feature_ids.hpp in Headers */, 6753441C1A3F644F00A0A8C3 /* route.hpp in Headers */, @@ -1224,6 +1241,7 @@ 6742AD351C68A9DF009CB89E /* turns_generator_test.cpp in Sources */, 6742AD301C68A9DF009CB89E /* road_graph_builder.cpp in Sources */, 6742AD2D1C68A9DF009CB89E /* nearest_edge_finder_tests.cpp in Sources */, + 5631B662219B0F66009F47D4 /* maxspeed_tests.cpp in Sources */, 6742AD321C68A9DF009CB89E /* route_tests.cpp in Sources */, 6742AD2A1C68A9DF009CB89E /* async_router_test.cpp in Sources */, 6742AD281C68A9DF009CB89E /* astar_progress_test.cpp in Sources */, @@ -1270,9 +1288,11 @@ 0C08AA341DF83223004195DD /* index_graph_serialization.cpp in Sources */, 5694CECA1EBA25F7004576D3 /* road_access_serialization.cpp in Sources */, 674F9BD41B0A580E00704FFA /* road_graph.cpp in Sources */, + 5631B66B219B125D009F47D4 /* maxspeeds.cpp in Sources */, 0C81E1571F0258AA00DC66DF /* segmented_route.cpp in Sources */, 56CA09E51E30E73B00D05C9A /* index_graph_tools.cpp in Sources */, 0C0DF92A1DE898FF0055A22F /* routing_helpers.cpp in Sources */, + 5631B66D219B125D009F47D4 /* maxspeed_serialization.cpp in Sources */, 67AB92E61B7B3E6E00AB5194 /* turns_tts_text.cpp in Sources */, 0C5FEC601DDE192A0017688C /* index_graph.cpp in Sources */, 0C5FEC6D1DDE19A40017688C /* index_graph_test.cpp in Sources */, diff --git a/xcode/routing_common/routing_common.xcodeproj/project.pbxproj b/xcode/routing_common/routing_common.xcodeproj/project.pbxproj index ef9bebc8ec..ad59092751 100644 --- a/xcode/routing_common/routing_common.xcodeproj/project.pbxproj +++ b/xcode/routing_common/routing_common.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ 40FF45D01F388EF80046BD40 /* vehicle_model_for_country_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 40FF45CF1F388EF80046BD40 /* vehicle_model_for_country_test.cpp */; }; + 5631B665219B11D5009F47D4 /* maxspeed_conversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5631B663219B11D5009F47D4 /* maxspeed_conversion.cpp */; }; + 5631B666219B11D5009F47D4 /* maxspeed_conversion.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5631B664219B11D5009F47D4 /* maxspeed_conversion.hpp */; }; 5647A4511F72BEB600DE1125 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5647A4521F72BEB600DE1125 /* libicu.a */; }; 56D0E47D1F8E335D0084B18C /* num_mwm_id.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56D0E47C1F8E335D0084B18C /* num_mwm_id.hpp */; }; 56EE14D91FE80FA30036F20C /* libtransit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EE14DA1FE80FA30036F20C /* libtransit.a */; }; @@ -39,6 +41,8 @@ /* Begin PBXFileReference section */ 40FF45CF1F388EF80046BD40 /* vehicle_model_for_country_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vehicle_model_for_country_test.cpp; sourceTree = ""; }; + 5631B663219B11D5009F47D4 /* maxspeed_conversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxspeed_conversion.cpp; sourceTree = ""; }; + 5631B664219B11D5009F47D4 /* maxspeed_conversion.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maxspeed_conversion.hpp; sourceTree = ""; }; 5647A4521F72BEB600DE1125 /* libicu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libicu.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5667C1DE1F751F4200C6B31B /* routing_common.pro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = routing_common.pro; sourceTree = ""; }; 56D0E47C1F8E335D0084B18C /* num_mwm_id.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = num_mwm_id.hpp; sourceTree = ""; }; @@ -131,6 +135,8 @@ 671E78741E6A3BE200B2859B /* routing_common */ = { isa = PBXGroup; children = ( + 5631B663219B11D5009F47D4 /* maxspeed_conversion.cpp */, + 5631B664219B11D5009F47D4 /* maxspeed_conversion.hpp */, 56D0E47C1F8E335D0084B18C /* num_mwm_id.hpp */, 5667C1DE1F751F4200C6B31B /* routing_common.pro */, 671E78801E6A3C5D00B2859B /* bicycle_model.cpp */, @@ -192,6 +198,7 @@ 671E78891E6A3C5D00B2859B /* bicycle_model.hpp in Headers */, 671E788B1E6A3C5D00B2859B /* car_model.hpp in Headers */, 671E788F1E6A3C5D00B2859B /* vehicle_model.hpp in Headers */, + 5631B666219B11D5009F47D4 /* maxspeed_conversion.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -287,6 +294,7 @@ files = ( 671E788A1E6A3C5D00B2859B /* car_model.cpp in Sources */, 671E78881E6A3C5D00B2859B /* bicycle_model.cpp in Sources */, + 5631B665219B11D5009F47D4 /* maxspeed_conversion.cpp in Sources */, 671E788E1E6A3C5D00B2859B /* vehicle_model.cpp in Sources */, 40FF45D01F388EF80046BD40 /* vehicle_model_for_country_test.cpp in Sources */, 671E788C1E6A3C5D00B2859B /* pedestrian_model.cpp in Sources */,