| 87 | } |
| 88 | |
| 89 | bool BuildRoadRestrictions(IndexGraph & graph, std::string const & mwmPath, std::string const & restrictionPath, |
| 90 | std::string const & osmIdsToFeatureIdsPath) |
| 91 | { |
| 92 | LOG(LINFO, ("Generating restrictions for", restrictionPath)); |
| 93 | |
| 94 | auto collector = std::make_unique<RestrictionCollector>(osmIdsToFeatureIdsPath, graph); |
| 95 | if (!collector->Process(restrictionPath)) |
| 96 | return false; |
| 97 | |
| 98 | if (!collector->HasRestrictions()) |
| 99 | { |
| 100 | LOG(LWARNING, |
| 101 | ("No restrictions created. Check that", restrictionPath, "and", osmIdsToFeatureIdsPath, "are available.")); |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | SerializeRestrictions(*collector, mwmPath); |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | } // namespace routing_builder |